#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 -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 positions and velocities of two curling stones.
Input
One integer on the first line indicates the number of cases. Then followed by cases, every case contains lines.
The first line consists of float numbers which describe the initial position of the center and the initial velocity 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 .
It is guaranteed that two curling stones won't collide or intersect initially.
Output
For each case, print one line with float numbers separated by space, rounded to digits after the decimal point. , are positions of the centers of the two curling stones after time .
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