QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 256 MB Total points: 100

#1079. 重叠地图

Statistics

Fred 和 Sam 正一起旅行。他们两人都有该地区的地图。这些地图覆盖的区域完全相同,且宽高比也完全一致,但 Sam 的地图比例尺比 Fred 的小,所以它稍微小一些。Fred 把他的地图放在桌子上,Sam 把他的地图叠放在上面。较小的地图经过了平移和旋转,但它仍然完全位于较大地图的上方。Fred 在较小的地图上插了一根针,针穿透了较小的地图并一直扎到了下面的大地图上。Sam 很惊讶!他说:“哇!你意识到那根针的位置在两张地图上代表的是同一个地点吗?”Fred 说:“这其实没什么好惊讶的。肯定存在这样一个点!”

给定大地图的尺寸,以及完全覆盖在大地图之上的小地图的偏移量、缩放比例和旋转角度,求出在两张地图上代表同一个地点的那个点。

输入格式

输入包含多个测试用例。每个测试用例由一行包含六个整数的数据组成:

$w\ h\ x\ y\ s\ r$

前两个整数 $w$ 和 $h$ ($0 < w, h \le 1,000$) 是大地图的宽和高。大地图位于平面上,西南角位于原点,西北角位于 $(0, h)$,东南角位于 $(w, 0)$,东北角位于 $(w, h)$。

接下来的两个整数 $x$ 和 $y$ ($0 \le x \le w, 0 \le y \le h$) 表示小地图西南角在平面上的 $(x, y)$ 坐标。

整数 $s$ ($0 < s < 100$) 表示小地图相对于大地图的缩放比例(百分比,$s=50$ 表示小地图的宽和高均为大地图的一半)。

整数 $r$ ($0 \le r < 360$) 是小地图绕其西南角逆时针旋转的角度(单位为度,$r=90$ 表示东南角被旋转到西南角的正北方)。

保证小地图完全位于大地图的边界内。输入以一行六个 $0$ 结束。

输出格式

对于每个测试用例,输出两个实数 $x$ 和 $y$,表示两张地图上代表同一个地点的点的 $(x, y)$ 坐标。输出保留两位小数,中间用单个空格隔开。不要输出任何多余的空格。不同测试用例的答案之间不要输出空行。

样例

样例输入 1

100 100 50 50 25 0
100 100 50 50 25 45
0 0 0 0 0 0

样例输出 1

66.67 66.67
45.59 70.53

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.