QOJ.ac

QOJ

حد الوقت: 3.0 s حد الذاكرة: 2048 MB مجموع النقاط: 100

#17324. 友達との待ち合わせ

الإحصائيات

友人たちは、すべての整数 $a$ に対して水平な道路 $y = a$ が、すべての整数 $b$ に対して垂直な道路 $x = b$ が走っている2次元マンハッタン格子上で幸せに暮らしています。各友人は2本の道路の交差点に位置しており、歩行速度(単位は格子単位/秒)を持っています。彼らは道路に沿ってその速度で移動することしかできません。

格子上の生活は退屈なため、友人同士で集まることがあります。彼らは、できるだけ早く共通の地点で出会えるような経路を通って互いに向かって移動します。(この地点は必ずしも道路の交差点である必要はありませんが、もちろん道路上にある必要があります。)彼らは、すべての可能な友人ペアの中で、出会うまでにかかる時間が最も長くなるのはどれくらいかを知りたいと考えています。

入力

入力の最初の行には、友人の数 $N$ ($2 \le N \le 2 \cdot 10^5$) が含まれます。

続く $N$ 行のそれぞれには、3つの整数 $x, y, v$ ($|x|, |y| \le 10^6, 1 \le v \le 10^6$) が含まれており、これは $(x, y)$ に位置し、格子に沿って $v$ 単位/秒で移動する友人を示しています。

出力

各ペアが最も早く出会うための最適な経路をとると仮定したとき、出会うまでにかかる時間が最も長くなるペアについて、その秒数を実数で出力してください。回答は、ジャッジの解との相対誤差または絶対誤差が $10^{-6}$ 以内であれば正解とみなされます。

入出力例

入力 1

3
0 0 1
1 1 3
-1 1 4

出力 1

0.5

入力 2

6
970000 560000 3
-530000 510000 1
-300000 210000 4
-780000 -180000 1
460000 420000 5
890000 600000 9

出力 2

622500.0

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.