pythagorean-triplets-15_28726
Pythagorean triplet (a,b,c) satisfies: 
You will be given an integer N. You have to count how many triplets a,b,c exist such that  
1 ≤ a ≤ b ≤ c ≤ N.

Input: 
First line contains T, the number of testcases. Each testcase consists of only one integer in one line.    

Output: 
For each testcase, print the required answer.   

Constraints: 
1 ≤ T ≤ 100 
1 ≤ N ≤ 10^6

SAMPLE INPUT
2
5
10

SAMPLE OUTPUT
1
2

Explanation

In first testcase, only one triplet ie. (3,4,5)
In second testcase, two triplets ie. (3,4,5),(6,8,10).
tri = lambda m,n:(m**2-n**2, 2*m*n, m**2+n**2)

def coprime(x, y):
	while y:
		x, y = y, x%y
	return x==1

n = input()
while n:
	n -= 1
	
	m = input()
	c, i = 0, 2
	l = int(pow(m,0.5)) + 1
	while i<l:
		j = 1
		while j<i:
			if coprime(i,j) and (i**2+j**2)<=m and (i-j)%2:
				c += m/(i**2+j**2)
			j += 1
		i += 1
	print c
2
5
10

SAMPLE 100
1560
2173
711
2318
1379
972
4300
7767
7760
8145
9804
6411
9504
7712
31
2854
3316
2336
1977
132
7800
1285
7018
1418
7730
9908
6396
2712
4660
7547
9308
2572
6072
19
4890
7451
991
5543
1571
8751
3688
1375
5162
9544
5440
1545
8751
8756
3881
728
8888
8033
8365
2258
9452
6095
8519
2200
8808
3179
6099
4468
2104
2172
4487
6994
5975
5478
8889
7546
4229
2577
5274
5743
8474
714
7289
7225
5822
7522
4305
1062
5556
2670
3321
1360
8766
1840
9912
3926
1371
6011
8394
3475
4535
2881
6822
511
4711
2063
1
2 1489
2181
588
2355
1290
852
4789
9385
9377
9903
12197
7559
11779
9310
11
2992
3560
2379
1961
75
9437
1186
8366
1331
9326
12350
7524
2821
5254
9074
11510
2657
7099
5
5548
8947
875
6395
1500
10739
4010
1284
5897
11840
6259
1470
10739
10744
4260
605
10926
9752
10203
2286
11719
7126
10421
2214
10810
3388
7128
4997
2098
2177
5020
8338
6974
6303
10926
9074
4698
2660
6038
6657
10348
590
8728
8648
6766
9038
4796
945
6417
2779
3562
1266
10760
1793
12355
4322
1279
7023
10234
3752
5086
3024
8094
398
5314
2058