#P14110. [ZJCPC 2017] Final Defense Line

[ZJCPC 2017] Final Defense Line

题目描述

There is a circle in the plane. Both the coordinates of the center and the radius are unknown.

Chiaki found three distinct points AA, BB and CC in the plane. And she also knows the shortest distance from each point to the circumference.

Chiaki would like to find the smallest circle according to above information.

Note that in general, a circle with infinite radius is a line. But in this problem, line is not considered as a circle.

输入格式

There are multiple test cases. The first line of input contains an integer TT (1T2×1051 \le T \le 2 \times 10^5), indicating the number of test cases. For each test case:

The first line contains three integers xax_a, yay_a and dad_a (100xa100,ya=0,1da100-100 \le x_a \le 100, y_a = 0, 1 \le d_a \le 100) denoting the coordinates of AA and the shortest distance to the circumference.

The second line contains three integers xbx_b, yby_b and dbd_b (100xb100,yb=0,1db100-100 \le x_b \le 100, y_b = 0, 1 \le d_b \le 100) denoting the coordinates of BB and the shortest distance to the circumference.

The third line contains three integers xcx_c, ycy_c and dcd_c (100xc,yc,dc100,dc0-100 \le x_c, y_c, d_c \le 100, d_c \ne 0) denoting the coordinates of CC and the shortest distance to the circumference.

If the distance is equal to 00, the point is on the circumference. If distance is greater than 00, the point is inside the circle. If distance is less than 00, the point is outside the circle and the shortest distance is the absolute value.

It is guaranteed that the minimum possible radius of the circle is at most 10410^4.

输出格式

For each test case, if there are infinite possible circles, output 1-1 in a single line. If there is no such circle, output 00 in a single line. Otherwise, output an integer mm and a real number rr in a single line separated by one space denoting the number of possible circles and the radius of the smallest circle. You answer will be accepted if the relative error of your answer is no more than 10610^{-6}.

2
0 0 1
3 0 2
10 2 2
0 0 1
3 0 2
10 2 -2
2 10.327329213469
2 5.341730785440

提示

The image below shows the sample.

:::align{center} :::