#P17213. [ICPC 2017 Nanning R] The Ball

[ICPC 2017 Nanning R] The Ball

Problem Description

:::align{center} :::

In the three dimensional Euclidean space (X,Y,Z)(X, Y, Z), the intersection of several half spaces and {X≤0,Y≤0,Z≤0}\{X \le 0, Y \le 0, Z \le 0\} forms an area with positive volume.

Here each half space is represented as a linear inequation AX+BY+CZ≤DAX + BY + CZ \le D. Our problem is to find the largest available ball fully locating in the area.

Input Format

The input contains several test cases. The first line of input contains an integer T(1≤T≤160)T (1 \le T \le 160) indicating the number of cases.

For each case, the first line contains an integer N(1≤N≤100)N (1 \le N \le 100) indicating the number of half spaces. Each of the following lines describes a half space given by four integers A,B,CA,B,C and DD corresponding to the linear inequation AX+BY+CZ≤DAX+BY +CZ \le D,where −100≤A,B,C,D≤100-100 \le A,B,C,D \le 100. The summation of N in input is up to 62006200.

Output Format

For each test case, output a line. If the size of available balls is unrestricted, output “Infinity”. Else, output the largest radius of an available ball with the precision of 44 digits after the decimal point.

5
3
1 0 0 1
0 1 0 1
0 0 1 1
1
1 1 1 1
2
-1 -1 -1 -2
1 2 3 7
2
1 0 0 1
0 0 1 1
1
1 -1 0 0
0.5000
0.2113
0.5901
0.5000
Infinity