A Pythagorean triple is three positive integers a, b, c with a2+b2=c2, written as (a,b,c). Picking integers x and y with x>y>0 and setting a=2xy, b=x2−y2, c=x2+y2 produces a Pythagorean triple.
R={R1,R2,…,Ri,…} is a set of rectangles. Rectangle Ri has width wi, height hi, and diagonal length di. When every rectangle in R satisfies the conditions below, the set is called a Pythagorean base rectangle set.
Changyoung, a student at Pythagoras High School, plays with a wire of length L. He cuts the wire into pieces and bends each piece into one rectangle, and the set of rectangles he ends up with must be a Pythagorean base rectangle set. Making Ri uses 2(wi+hi) of wire.
Write rectangle Ri as the pair of width and height (wi,hi). When L is 94, Changyoung can make 3 rectangles, for instance R={(3,4),(5,12),(8,15)}. Building R={(3,4),(7,24)} from the same wire leaves him with only 2 rectangles.
Given L, write a program that finds the largest number of rectangles Changyoung can make.
The first line contains the number of test cases T. Each test case is a single line holding the wire length L. (14≤L≤1,000,000)
For each test case, print on one line the largest number of rectangles Changyoung can make from a wire of length L.