Teleport

Time limit: 0.5s Memory limit: 32MB Input: Output:

Everyone knows that in Bugland rooms are an infinite plane surface in which each point is described by two coordinates (x,y)(x, y). Two bugs AA and BB can be found at coordinates (Xa,Ya)(X_a, Y_a) and (Xb,Yb)(X_b, Y_b).

It is well known that in Bugland beds are perfect circles, described by the coordinates of the center of the circle and its radius. In the room in which the two bugs live there is also a single bed with center at (Xc,Yc)(X_c, Y_c) and radius RR.

AA and BB want to meet but they want to be as silent as possible. Walking on the floor one unit makes 1 NPU1\ NPU (Noise per Unit), for example walking from (1,1)(1, 1) to (3,1)(3, 1) makes 2 NPU2\ NPU, and walking from (1,1)(1, 1) to (2,2)(2, 2) makes 2NPU\sqrt{2} NPU. On the other hand, walking on the bed is completly silent.

Help the two bugs AA and BB meet such that the sum of their NPUsNPUs is minimal.

Input data

The first line will contain the number of tests TT. Each test is described by 77 integer numbers:

XaX_a, YaY_a, XbX_b, YbY_b, XcX_c, YcY_c, RR, where XaX_a, YaY_a, XbX_b, YbY_b are the position of the two bugs and XcX_c, YcY_c and RR are the center and the radius of the bed.

Output data

You will print TT lines, the ithi^{th} line containing the answer for the ithi^{th} query. The printed numbers have to have EXACTLY 66 decimals, rounded down.

It is guaranteed that the 7th7^{th} decimal of the answer is inside the interval [2,7][2, 7].

Constraints and clarifications

  • 1T1051 \leq T \leq 10^5
  • 106Xa,Ya,Xb,Yb,Xc,Yc,R106-10^6 \leq X_a, Y_a, X_b, Y_b, X_c, Y_c, R \leq 10^6
  • PAY ATTENTION to printing real numbers!

Example

stdin

1
0 0 5 2 2 1 1

stdout

3.398345

Log in or sign up to be able to send submissions!