I am a ball on a circle table. The table's surface is so smooth that I can move without energy lost.
Now you are to give me a hit vector, I want to know where I will be after T seconds. Collisions between me and the edge of the table satisfy Conservation of Momentum Theorem , also my speed after collision is as fast as before. Look for the figure below to know it more clearly:
The first line contains a number N, the number of test cases you have to proceed.
Each test case has three lines.First line has three numbers, x
1,y
1,r
1, the center and radius of the table. Second line has x
2,y
2,r
2, the parameters of me (the ball). The third line consists of dx, dy, T: (dx,dy) is the hit vector, T is the time I have moved since you hit me. To explain hit vector: if I am at position (x
0,y
0) now ,next second I will be at position (x
0+dx,y
0+dy) without conllision. All input numbers are non-negative integer and less than 10^6.Also you can assume the ball must be in the table.
Please output two float number x , y,which mean the center position of the ball after T seconds and round to just one decimal places.