The Hunter

No attempts yetTime limit1sMemory limit128 MB

Problem

Rexxar shouts, "I will hunt you down!"

Rexxar is a legendary hunter who catches angry chickens with a harpoon tied to a rope. Rope has grown expensive lately, and that worries him.

A stone henge shaped like a cylinder of radius RR stands at the origin (0,0)(0, 0) of the plain where he hunts. It is infinitely tall and solid, so the rope cannot pass through it. The rope is spun from microfibre, so its thickness is negligible, and Rexxar can throw the harpoon along any path he likes and still hit the chicken.

Rexxar stands at (X1,Y1)(X_1, Y_1) and the angry chicken sits at (X2,Y2)(X_2, Y_2). The rope lies flat on the plain and may not enter the stone henge. Find the shortest rope that connects the two points.

Input

The first line contains the number of test cases TT (1T10001 \le T \le 1000).

Each of the next TT lines contains five real numbers X1X_1, Y1Y_1, X2X_2, Y2Y_2, RR separated by spaces. Rexxar is at (X1,Y1)(X_1, Y_1), the angry chicken is at (X2,Y2)(X_2, Y_2), and the stone henge has radius RR (10000X1,Y1,X2,Y210000-10000 \le X_1, Y_1, X_2, Y_2 \le 10000, 0<R100000 < R \le 10000).

Both positions lie outside the stone henge or on its boundary, so each one is at distance at least RR from the origin.

Output

For each test case, print the shortest rope length on its own line, rounded at the fourth decimal place and given to three decimal places.