SP261 TRIPART - Triangle Partitioning

Description

A triangle can be divided into two equal triangles by drawing a median on its largest edge (in the figure below such a division is shown with the red line). Then the smaller two triangles can be divided in similar fashion into equal triangles (shown in the picture below with blue lines). This process can continue forever. ![](https://cdn.luogu.com.cn/upload/vjudge_pic/SP261/affbb7bede32425c1836e0da8de3e3534e900ecb.png) Some mathematicians have found that when we split a triangle into smaller ones using the method specified above we have only some "styles" of triangles that only differ in size. So now given the lengths of the sides of the triangle your job is to find out how many different styles of small triangles we have. (Two triangles are of same style if they are similar.)

Input Format

First line of the input file contains an integer _N (0 < N < 35)_ that indicates how many lines of input there are. Each line contains three integers _a, b, c (0 < a,b,c < 100)_ which indicate the sides of a valid triangle. (A valid triangle means a real triangle with positive area.)

Output Format

For each line of input you should produce an integer _T_, which indicates the number of different styles of small triangles, formed for the triangle at input. Look at the example for details. You can safely assume that for any triangle _T_ will be less than _100_.