当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

7205:Map

Special Judge 特殊评判
题目描述
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.

输入解释
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.
输出解释
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} $.
输入样例
1
0 5
15 5
15 0
0 0
3 2
9 5
10 3
4 0
输出样例
6.000000 2.000000
来自杭电HDUOJ的附加信息
Hint In the first example, the picture is like this:

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-7205

最后修改于 2022-09-15T06:17:21+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
20000/10000MS(Java/Others) 524288/262144K(Java/Others)