#1292 Radar Finder

23  1 s   128 MB  


You are the commander of a military operation that is focused on determining the location of an enemy unit. Two radar stations have provided measurements of their calculated distance from the enemy unit. You are given the locations of your radar stations in integers x1, y1 and x2, y2, and the calculated distances in integers r1 and r2, respectively.

You are to compute an integer indicating the number of possible locations of the enemy unit. If there are an infinite number of possible locations, return -1.


 The first line contains the number of test cases T (T ≤ 500).

For each test case, x1, y1, r1, x2, y2, r2 will be given on a single line.


 Output the answer of each test case on a separate line.

Sample Input

Sample Output

0 0 13 40 0 37
0 0 3 0 7 4