I. 2D Pinball
You are playing a game called 2D Pinball.
- The game field is a square region. The coordinates of the four vertices of the square are given in clockwise order as $(x_1, y_1)$, $(x_2, y_2)$, $(x_3, y_3)$, and $(x_4, y_4)$.
- There is a small ball initially at rest in the field. The initial position of the ball is $(x_0, y_0)$ (guaranteed to be strictly inside the square), and its initial velocity is $0$.
- The ball is considered a point mass and follows physical laws, subject only to a downward gravitational acceleration $g = 10$.
- When the ball hits one of the boundaries of the square, an elastic collision occurs: after the collision, the velocity component in the normal direction is reversed, the velocity component in the tangential direction remains unchanged, and the magnitude of the velocity remains constant.
- Specifically, when the ball hits a vertex (corner) of the square, both components of the velocity are reversed (i.e., the velocity becomes $(-v_x, -v_y)$).
- Any collision is considered to be instantaneous (there is no situation where the ball stays on the boundary for a long time). There is no energy loss during the entire motion of the ball.
Given the coordinates of the four vertices of the square $(x_1, y_1)$, $(x_2, y_2)$, $(x_3, y_3)$, $(x_4, y_4)$, the initial position of the ball $(x_0, y_0)$, and the time $t$ for which the ball moves, you want to know the position $(x, y)$ of the ball after $t$ seconds.
Input
This problem contains multiple test cases. The first line contains an integer $T$ ($1 \le T \le 10^4$), representing the number of test cases.
For each test case: First, input 4 lines, where the $i$-th line contains two integers $x_i, y_i$ ($|x_i, y_i| \le 10^4$) representing the $i$-th vertex of the square. Next, input one line containing three integers $x_0, y_0, t$ ($0 \le |x_0|, |y_0| \le 10^4$, $0 < t \le 10^6$) representing the initial position and the elapsed time.
It is guaranteed that the four vertices of the square are given in clockwise order. It is guaranteed that the initial position of the ball is strictly inside the square.
Output
For each test case: Output one line containing two numbers representing the position $x, y$ of the ball after $t$ seconds. You need to ensure that the relative error or absolute error between your answer and the standard answer is within $10^{-5}$. That is, if your answer is $a$ and the standard answer is $b$, your answer is considered correct if $\frac{|a-b|}{\max(1, |b|)} \le 10^{-5}$.
Examples
Input 1
2 0 0 0 20 20 20 20 0 5 5 5 -10 0 0 10 10 0 0 -10 0 0 12
Output 1
5.0000000000 0.0000000000 0.0000000000 -2.3549801218