QOJ.ac

QOJ

Límite de tiempo: 2.0 s Límite de memoria: 256 MB Puntuación total: 100

#18097. 禮物配送

Estadísticas

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

3 2 -1 10 5 2

輸出格式 2

2.306019375

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.