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

FJ רשם קואורדינטות $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.