QOJ.ac

QOJ

时间限制: 1.0 s 内存限制: 512 MB 总分: 100 可 Hack ✓

#16848. 两条异面道路

统计

在阅读某场比赛(未评级,组队赛优先)中又一个被某些人称为极其重要的无聊题目的题面时,你陷入了对家乡 Berlodar 的怀念与思索。你回想起自己是多么喜欢沿着家乡的两条主干道——Holmes Avenue 和 Watson Street 散步,这两条路将城市分成了四个巨大的街区。你微微一笑,想起了很久以前在五年级的一堂课上,数学老师给你讲了角度和距离,你的眼睛顿时亮了起来。在接下来的整个晚上,你在城市的主要十字路口来回踱步,测量出 Holmes Avenue 的宽度为 $\ell_H$ 米,Watson Street 的宽度为 $\ell_W$ 米,它们以 $\alpha$ 度的夹角相交。回到家后,你翻出了城市地图,高兴地确认了你的测量结果是正确的。

不久后,你将在新年假期回到 Berlodar,并想拜访你的四位朋友。他们都住在不同的街区,因此为了拜访所有的朋友,你必须多次穿过主干道,有时甚至两条都要穿过。在规划你的步行路线时,你会想:在这些街区之间,你需要走多长的距离?这两条街道的红绿灯控制方式意味着所有行人的绿灯(相应地,两条道路上车辆的红灯)是同时亮起的。因此,为了在任意一对街区(即使是互相对立的街区)之间往返,你将沿着连接它们边界的最短线段行走。

一共有 $\frac{4 \cdot (4-1)}{2} = 6$ 对街区。编写一个程序,输出六个数字,表示 Berlodar 各街区之间的两两距离。

输入格式

输入仅包含一行,有三个实数 $\ell_H$、$\ell_W$ 和 $\alpha$,分别表示 Holmes Avenue 的宽度(单位:米)、Watson Street 的宽度(单位:米)以及它们相交的夹角(单位:度,满足 $0.01 \le \ell_H, \ell_W \le 1000$;$0.1 \le \alpha \le 90$)。这三个数字中的每一个都将给出至多三位小数。

输出格式

以任意顺序输出六个实数——Berlodar 四个街区之间的两两距离(单位:米)。如果相对误差或绝对误差不超过 $10^{-6}$,你的答案将被接受。正式地,如果 $\{a_i\}_{i \in [1..6]}$ 是你的答案,而 $\{b_i\}_{i \in [1..6]}$ 是裁判的答案,如果在重新排列后,对于每个索引 $i \in [1..6]$,都满足条件 $\frac{|a_i - b_i|}{\max\{b_i, 1\}} \le 10^{-6}$,则答案被视为正确。

样例

输入 1

23.332 32.17 76.055

输出 1

23.332 23.332000 32.17 32.170 35.95260 45.39539

输入 2

3 4 90

输出 2

5 4 3 3 4 5

输入 3

400 300 70

输出 3

400 300 400 300.0 613.251621126 436.073

说明

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.