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

    ID: 16747 Type: RemoteJudge 14000ms 512MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>搜索2017数论ICPC青岛

[ICPC 2017 Qingdao R] Pythagoras, One More Time

题目描述

“Pythagoras, One More Time” triples over nn are all solutions of x2+y2=z2−7x^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 x≤y≤zx \le y \le z.

输入格式

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

输出格式

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