|
||||||||||
MapTime Limit: 20000/10000 MS (Java/Others) Memory Limit: 524288/262144 K (Java/Others)Total Submission(s): 1074 Accepted Submission(s): 419 Special Judge Problem Description Sakuyalove has a large world map $M$ and a small world map $m$. Both of the them are in the shape of rectangle. The small map $m$ is compressed from the large map $M$. If the length of $M$ is $a$ and the width of $M$ is $b$, then the length of $m$ is $ka$ and the width of $m$ is $kb$, where $0 < k < 1$. Now Sakuyalove puts the small map $m$ on the large map $M$ such that the small map is completely within the big map (including boundaries). She was surprised to find out that no matter how she places the small map, there always exists exactly one point $P$ represents the same place in small map and large map (For example, in the following pictures, the location of the pin on both maps represents Tokyo, Japan). Sakuyalove wants to find out this point $P$. Please help her. Input The first line contains one integer $T(1\le T\le 10^5)$, described the number of test cases. Each test case contains eight lines. Each line has two integers $x, y (-10^{3}\leq x, y\leq 10 ^ 3)$ separated by one space. The first four lines are the coordinates of the upper left corner, the upper right corner, the lower right corner and the lower left corner of $M$. The last four lines are the coordinates of the upper left corner, the upper right corner, the lower right corner and the lower left corner of $m$. It is guaranteed that $m$ is within $M$, both of the them are in the shape of rectangle, and $m$ is compressed from $M$. Please note that the upper left corner, the upper right corner, the lower right corner and the lower left corner of $m$ and $M$ are one-to-one corresponding. For example, in the picture of Hint below, the correspondence of points is $A-a$, $B-b$, $C-c$, $D-d$. But $A-c$, $B-d$, $C-a$, $D-b$ is not allowed. Output Your output should contains $T$ lines. Each line contains two real numbers $x, y$ separated by one space, represents the coordinates of the point $P$. Your absolute error should not exceed $10 ^ {-6} $. Sample Input
Sample Output
Hint In the first example, the picture is like this: Source | ||||||||||
|