Space Junk

Two spheres drift on straight paths at constant speeds, and you compute the first instant their surfaces touch or report no collision.

Easy3MathGeometryInterviewNo attempts yetTime limit4sMemory limit256 MB

Problem

According to NASA's web page, more than 500 000 pieces of space junk are tracked. Mission planning has to keep satellites and other spacecraft from running into those pieces.

This problem uses a simplified model in which the spacecraft and the piece of space junk are both spheres moving along a straight line at constant velocity. Given the current position, radius and velocity of each sphere, find the time at which the two spheres first collide. The collision happens the moment their surfaces first touch, that is, the earliest time at which the distance between the two centers equals the sum of the two radii.

Input

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

Each test case consists of two lines. The first line describes the sphere representing the spacecraft and the second line describes the sphere representing the space junk. Each sphere is given by seven integers xx, yy, zz, rr, vxv_x, vyv_y, vzv_z. The center of the sphere is currently at (x,y,z)(x, y, z), its radius is rr, and it travels along the direction vector (vx,vy,vz)(v_x, v_y, v_z). If that vector is (0,0,0)(0, 0, 0), the sphere is stationary.

The absolute value of every integer is at most 100, and rr is positive. Coordinates and radii are measured in meters, and velocities in meters per second.

The two spheres do not touch each other initially.

Output

For each test case, print on its own line the time in seconds at which the spacecraft first collides with the space junk. Round the value to exactly three digits after the decimal point and keep trailing zeros. If the two spheres never collide, print No collision instead.

The input is chosen so that the value rounded to three decimal places is unambiguous.