DJ 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:||0.5 sec|
|Source Limit:||50000 Bytes|
|Languages:||ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, CPP 4.3.2, CPP 6.3, CPP14, CS2, D, ERL, FORT, FS, GO, HASK, ICK, ICON, JAVA, JS, LISP clisp, LISP sbcl, LUA, NEM, NICE, NODEJS, PAS fpc, PAS gpc, PERL, PERL6, PHP, PIKE, PRLG, PYPY, PYTH, PYTH 3.5, RUBY, SCALA, SCM chicken, SCM guile, SCM qobi, ST, TCL, TEXT, WSPC|
Fetching successful submissions
If you are still having problems, see a sample solution here.