QOJ.ac

QOJ

実行時間制限: 2 s メモリ制限: 256 MB 満点: 100

#22321. ああ、このローラーたち

統計

Farmer John は干草を牛舎へ持ち上げる際の力を軽減する新しいウインチを設置しました。Rube Goldberg Winch Company 製で、ローラーが多すぎて理解できません。大きな鋼板に多くのローラーがあり、動力源は FJ が原点 $(0,0)$ とした駆動ローラーです。これが次を回し、次がさらに次を回し、最後まで続きます。FJ は最後のローラーがどれか探しています。

download.php?type=attachments&id=2917&r=0

$N$ $(2 \le N \le 1080)$ 個それぞれの座標 $x_{i}$、$y_{i}$ $(-5,000 \le x_{i} \le 5,000; -5,000 \le y_{i} \le 5,000)$ と半径 $r_{i}$ $(3 \le r_{i} \le 1024)$ を記録しました。回されるが他を回さない最後のローラーの $x,y$ 座標を求めてください。駆動ローラー以外はちょうど一つの他のローラーに回されます。

入力

  • 1 行目:整数 $N$ 一つ。
  • $2,\ldots,N+1$ 行目:第 $i+1$ 行はローラー $i$ を表す空白区切り整数 $x_{i}$、$y_{i}$、$r_{i}$。

出力

  • 1 行目:最後のローラーの $x,y$ 座標をこの順に、空白区切りの整数二つで一行に出力。

入出力例

入力 1

3
0 0 30
30 40 20
-15 100 55

出力 1

-15 100

注記

三つのローラーです。最初は原点で半径 30、位置 $(30,40)$、半径 20 のものを回します。これが位置 $(-15,100)$、半径 55 の三つ目を回します。

問題作成者:Rob Kolstad、2008

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.