Circle

아직 제출이 없습니다시간 제한3초메모리 제한512 MB

문제

There are two points AA and BB and an obstacle circle OO on a Cartesian plane.

Now, you need to choose a point CC on the boundary of OO and then move both points AA and BB to point CC. While moving, the path of either point AA or BB can only go outside circle OO or touch its boundary.

Your goal is to minimize the total moving distance, that is, the sum of the moving distances of AA and BB.

입력

The first line contains a single integer t (1t105)t\ (1 \le t \le 10^5), the number of test cases.

Each test case is given on a single line and contains seven integers x_1,y_1,x_2,y_2,x_3,y_3,rx\_1, y\_1, x\_2, y\_2, x\_3, y\_3, r, where 103x_1,y_1,x_2,y_2,x_3,y_3103-10^3 \le x\_1, y\_1, x\_2, y\_2, x\_3, y\_3 \le 10^3 and 1r1031 \le r \le 10^3. Here, A=(x_1,y_1)A = (x\_1, y\_1), B=(x_2,y_2)B = (x\_2, y\_2), and OO is a circle centered at (x_3,y_3)(x\_3, y\_3) with radius rr. It is guaranteed that neither AA nor BB is strictly inside OO.

출력

For each test case, output a single line with a single real number: the answer rounded to the third decimal place. It is guaranteed that the fourth decimal place is neither 44 nor 55.