#P17098. [ICPC 2017 Qingdao R] Pythagoras, One More Time

[ICPC 2017 Qingdao R] Pythagoras, One More Time

Problem Description

“Pythagoras, One More Time” triples over nn are all solutions of x2+y2=z27x^2 + y^2 = z^2 - 7 where xx, yy and zz are constrained to be positive integers less than or equal to nn.

You are to calculate the number of the triples (x,y,z)(x, y, z) such that xyzx \le y \le z.

Input Format

The first line is an integer TT (1T100001 \le T \le 10000) indicating the total number of cases. For each test case a line contains the integer nn (1n1081 \le n \le 10^8).

Output Format

For each case output the total number of triples in a line.

10
1
2
3
4
5
6
7
8
9
10
0
0
1
1
2
3
3
3
4
4