QOJ.ac

QOJ

Limite de temps : 2.0 s Limite de mémoire : 256 MB Points totaux : 100

#18097. 礼物派送

Statistiques

Taja 的工作中出了点麻烦:卡车司机病倒了,而此时正急需将礼物从一家商店运送到另一家。幸运的是,她目前正在休息,且这家商店位于同一条街道上,因此她仅以恒定速度 $v_1$ 向前驾驶的技能足以应对这种情况。

但在通往商店的路上,有一个十字路口的交通信号灯坏了,现在那里有一名交通协管员,他本不应该离开自己的岗位。

某一刻,他注意到卡车正朝他驶来,且没有避让的打算。他本不应该移动——否则会受到处罚——但无论如何他都必须移动。因此,交通协管员希望以某种方式让卡车通过,使得他离开初始位置的时间尽可能短。交通协管员可以向任何方向移动,但其速度不能超过 $v_2$。

将卡车视为一个矩形,将交通协管员视为一个点。要求该点在任何时刻都不能严格位于矩形内部,且该点不在 $(p, q)$(其初始位置)的时间总和应尽可能小。

输入格式

第一行包含 6 个整数 $a, b, p, q, v_1, v_2$ ($1 \le a \le 100, 0 \le b \le 99, -a < p < a, b < q \le 100, 1 \le v_1, v_2 \le 100$)。初始时,卡车的左上角位于 $(-a, b)$,右下角位于 $(a, 0)$。交通协管员初始站在点 $(p, q)$。卡车以恒定速度 $v_1$ 向第二坐标增大的方向移动。交通协管员的最大速度为 $v_2$。若 $b = 0$,则将卡车的长度视为所需的最短长度。

所有距离以米为单位,速度以米每秒为单位。

保证所有数值使得答案不超过 $10\,000$。

输出格式

输出一个实数——交通协管员不在 $(p, q)$ 点的最短总时间。答案的绝对误差或相对误差不应超过 $10^{-6}$。

样例

样例输入 1

4 0 1 5 1 1

样例输出 1

6

样例输入 2

3 2 -1 10 5 2

样例输出 2

2.306019375

说明

在第一个样例中,最优策略是等待 2 秒,然后以最大速度向右移动 3 秒,接着以最大速度向后左方移动。

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.