QOJ.ac

QOJ

시간 제한: 2 s 메모리 제한: 256 MB 총점: 100

#22321. Ôi những con lăn

통계

Farmer John lắp tời mới giúp lợi về lực khi nâng kiện cỏ vào chuồng. Do Rube Goldberg Winch Company sản xuất, nó có quá nhiều con lăn đến khó hiểu. Trên tấm thép khổng lồ, các con lăn nhận lực từ con lăn chủ động mà FJ đặt tại gốc $(0,0)$. Nó truyền động cho con khác, con ấy truyền tiếp, đến con cuối. FJ muốn biết con cuối là con nào.

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

FJ ghi tọa độ $x_{i}$,$y_{i}$ $(-5,000 \le x_{i} \le 5,000; -5,000 \le y_{i} \le 5,000)$ và bán kính $r_{i}$ $(3 \le r_{i} \le 1024)$ của $N$ $(2 \le N \le 1080)$ con lăn. Hãy cho tọa độ $x,y$ của con cuối chuỗi: được truyền động nhưng không truyền cho con khác. Trừ con chủ động, mỗi con được đúng một con khác truyền động.

Dữ liệu vào

  • Dòng 1: một số nguyên $N$.
  • Dòng $2,\ldots,N+1$: dòng $i+1$ mô tả con lăn $i$ bằng ba số nguyên cách nhau dấu cách: $x_{i}$, $y_{i}$, $r_{i}$.

Dữ liệu ra

  • Dòng 1: hai số nguyên cách nhau dấu cách, lần lượt tọa độ $x,y$ của con lăn cuối chuỗi.

Ví dụ

Dữ liệu vào 1

3
0 0 30
30 40 20
-15 100 55

Dữ liệu ra 1

-15 100

Ghi chú

Ba con lăn. Con đầu ở gốc bán kính 30, truyền cho con ở $(30,40)$ bán kính 20. Con ấy truyền cho con thứ ba ở $(-15,100)$ bán kính 55.

Tác giả: 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.