#Lutece0117. Curling

Curling

Migrated from Lutece 117 Curling

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

.

Curling is one of StephYDX's favorite sports in the Vancouver 2010 Winter Olympics. StephYDX likes predicting how two curling stones moves after collision, but due to his poor knowledge of physics he always makes mistake. Now it's your turn to help him.

For simplicity, we regard the curling stone as a circle with unit radius on a 22-D plane, and you can simply just ignore restriction of the curling sheet. In addition, all curling stones are of the same mass and collision between them is perfectly elastic (no energy loss). You will be given the initial t=0t = 0 positions and velocities of two curling stones.

Input

One integer TT on the first line indicates the number of cases. Then followed by TT cases, every case contains 33 lines.

The first line consists of 44 float numbers x,y,vx,vyx, y, v_x, v_y which describe the initial position of the center (x,y)(x, y) and the initial velocity (vx,vy)(v_x, v_y) of one curling stone. The second line describes the other curling stone with the same format as the first line. The last line contains only one float number tt.

It is guaranteed that two curling stones won't collide or intersect initially.

Output

For each case, print one line with 44 float numbers x1,y1,x2,y2x_1, y_1, x_2, y_2 separated by space, rounded to 33 digits after the decimal point. (x1,y1)(x_1, y_1), (x2,y2)(x_2, y_2) are positions of the centers of the two curling stones after time tt.

Samples

2
0 0 1 0
5 0 0 0
2.5
0 0 1 0
5 0 0 0
3.5
2.500 0.000 5.000 0.000
3.000 0.000 5.500 0.000

Resources

The 8th UESTC Programming Contest Final