Preserving Row Order With sort=False
A Halden Cycle Hire survey trolley is pushed along a towpath and logs its position every few seconds, one line per fix, in the order it travelled. The path doubles back on itself, so the same across-the-path distance turns up more than once and the log is nothing like sorted. The team needs to know where the trolley finished.
Task: Print the y value of the last fix in the log.
Input
The first line holds one integer n, the number of fixes, where 1 <= n <= 1000. Then come n lines, each holding an x and a y value separated by a single space, in the order the trolley recorded them.
Output
One line holding the y value of the final fix, rounded to 2 decimal places. Final means last in the log: it need not be the fix with the largest x, and it need not be the fix with the largest y.
Example:
Input:
3
5 100
1 200
3 300
Output:
300.00
Sign in to solve this problem
Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.
Sign in