Marcus is a mathematician working at the University of Waterloo. Recently, he had been playing with triangles, and as he is a magnificent mathematician, he soon discovered a powerful formula to count right triangles under a certain hypotenuse. Are you able to keep up with Marcus?
More formally, given an integer hypotenuse
Lastly, to ensure the runtime and integrity of your solution, it will be run on
Your solution will be accepted if it has a relative error of at most
If your answer is
It is guaranteed that the output data has exactly the correct answer.
Constraints
For all subtasks:
Subtask 1 [10%]
Subtask 2 [10%]
Subtask 3 [20%]
Subtask 4 [60%]
Input Specification
The first line will contain
The next
Output Specification
Output the answer to each test case on a separate line.
Note: while the correct answer is always an integer, the float
checker is used to determine if your solution is correct, so outputting a floating-point value is OK.
Sample Input
10
1
2
3
4
5
6
7
8
9
10
Sample Output
0
1
4
8
15
22
30
41
54
69
Explanation
Here are the answers for the first few test cases:
For
For
For
For
Comments