QOJ.ac

QOJ

Süre Sınırı: 2 s Bellek Sınırı: 256 MB Toplam puan: 100

#22321. 아, 저 롤러들

İstatistikler

Farmer John은 건초 묶음을 헛간으로 올릴 때 힘을 덜 쓰게 하는 새 윈치를 설치했습니다. Rube Goldberg Winch Company 제품으로 롤러가 너무 많아 이해하기 어렵습니다. 거대한 강판에 여러 롤러가 있고 동력은 FJ가 원점 $(0,0)$으로 지정한 구동 롤러에서 옵니다. 이 롤러가 다음을 돌리고 그 롤러가 또 다음을 돌려 마지막까지 이어집니다. FJ는 마지막이 어느 롤러인지 알고 싶습니다.

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

각 롤러의 좌표 $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)$를 기록했으며 모두 $N$ $(2 \le N \le 1080)$개입니다. 돌려지지만 다른 롤러를 돌리지 않는 마지막 롤러의 $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.