QOJ.ac

QOJ

実行時間制限: 2.0 s メモリ制限: 256 MB 満点: 100 ハック可能 ✓

#14124. 雨

統計

下雨了。一个球形的人想要在尽可能少淋雨的情况下登上公交车。为了上车,这个人必须与公交车处于同一个位置。你需要计算他最少会被多少雨水淋到。所有的坐标和速度都以秒差距(parsecs)为单位,而人和公交车的尺寸以毫米(millimeters)为单位。一毫米远小于一秒差距,因此我们可以忽略在开始时以及上车瞬间,雨、人和公交车之间的所有相互作用。

输入格式

有多个测试用例。测试用例的数量不超过 $10^5$。每个测试用例由单独的一行描述,包含 12 个整数:

  • $c$ ($0 \le c \le 1000$) — 每小时落在每平方毫米上的雨水量(单位:升)。
  • $rx, ry, rz$ ($-1000 \le rx, ry \le 1000, -1000 \le rz \le -1$) — 雨水速度的三维向量,单位为秒差距每小时。
  • $R$ ($0 \le R \le 1000$) — 人的身体半径,单位为毫米。
  • $hx, hy$ ($-1000 \le hx, hy \le 1000$) — 人的初始坐标,单位为秒差距。
  • $s$ ($0 \le s \le 1000$) — 人的最大速度,单位为秒差距每小时。
  • $bx, by$ ($-1000 \le bx, by \le 1000$) — 公交车的初始坐标,单位为秒差距。
  • $vx, vy$ ($-1000 \le vx, vy \le 1000$) — 公交车的速度向量,单位为秒差距每小时。

输出格式

对于每个测试用例,在单独的一行中输出答案。如果无法追上公交车,则输出 $-1$;否则输出最少淋雨量(单位:升),误差不超过 $10^{-9}$(相对误差或绝对误差)。

样例

输入样例 1

100 10 0 -30 10 0 0 10 300 0 -20 0
0 10 20 -30 15 0 0 10 10 10 0 10
0 10 20 -30 15 0 0 10 10 -10 0 10

输出样例 1

314159.2653589793
-1
0.0000000000

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.