D. Dual Star
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

In the far-away galaxy of Phitron, a rare cosmic phenomenon known as a Dual Star System can be observed.

The system consists of two identical spherical planets, each with same radius, rotating on a circular orbit. The center of their rotation is the midpoint of the two planet centers. Throughout the motion, the two planets always remain on opposite sides of the orbit.

An astronaut living on a space station at the origin $$$(0,0,0)$$$ is fascinated by this phenomenon. He is feeling lazy today and he decided only to start his daily routine if he can draw a single straight line from his position that intersects or touches both planets at the same time.

Figure: Dual Star System in three-dimensional space.

You are given the current coordinates of the centers of the two planets, $$$C_1$$$ and $$$C_2$$$, along with their common radius $$$r$$$ and angular speed $$$\omega$$$. The planets rotate with this speed, but the direction of rotation is unknown: it may be clockwise or counter-clockwise.

It is guaranteed that the space station lies on the same plane as the orbit of the planets. It is also guaranteed that the distance from the origin to the center of rotation is strictly greater than the radius of the circular orbit and planets are non-overlapping.

Since the direction of rotation is unknown, the astronaut wants to know the earliest possible time at which the alignment can occur, assuming the planets rotate in the more favorable direction.

Determine whether the alignment is possible. Print $$$-1$$$ if it is impossible, otherwise the minimum time at which it occurs.

Input

Each test contains multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of the test cases follows.

Each test case consists of four lines.

The first line contains three integers $$$x_1, y_1, z_1$$$ ($$$-10^9 \le x_1, y_1, z_1 \le 10^9$$$) — the coordinates of the center of the first planet $$$C_1$$$.

The second line contains three integers $$$x_2, y_2, z_2$$$ ($$$-10^9 \le x_2, y_2, z_2 \le 10^9$$$) — the coordinates of the center of the second planet $$$C_2$$$.

The third line contains a single integer $$$r$$$ ($$$1 \le r \le 10^9$$$) — the radius of each planet.

The fourth line contains a real number $$$\omega$$$ ($$$0 \lt \omega \le 10$$$) — the angular speed of rotation in radians per second. It is guaranteed that $$$\omega$$$ contains at most $$$4$$$ digits after the decimal point.

Output

For each test case, print $$$-1$$$, or the required minimum time in a single line.

Your answer will be considered correct if its absolute or relative error does not exceed $$$10^{-4}$$$.

Example
Input
3
3 2 5
9 6 15
2
1.5
8 2 0
12 -2 0
1
0.606
10 -12 20
12 -2 15
2
0.1265
Output
0
0.699721
5.000094
Note

A radian is the SI unit for measuring angles, defined as the angle subtended at the center of a circle by an arc whose length is equal to the circle's radius. One radian is approximately equal to $$$57.295779513^\circ$$$. To be exact, $$$$$$ 1\ \mathrm{rad}=\frac{180}{\pi}^\circ. $$$$$$ You can use $$$\pi = \texttt{acos(-1.0)}$$$