Divjot and Triangles
All submissions for this problem are available.
Divjot is a weird kid, he loves mathematics and athletics. He practice athletics in the morning at the local ground of his community. The ground is of infinite length with a wall of height H at one end. Since he loves mathematics he wonder how many right angled triangles are possible with height H and base being his distance from the wall(Base and hypotenuse should be integer value and height H is given a integer). As Divjot is running right now, he asks for your help.
First line consists of T – no. of test cases.
T lines follows.
Each test contains single integer H - height of the wall.
Output contains T lines.
Output single integer, the number of right angled triangles possible for each test case.
Input: 4 4 7 12 15 Output: 1 1 4 4 Explanation
For first test case only 1 right angled triangle is possible i.e. 4 3 5.
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, CLOJ, FS|
Fetching successful submissions