The Top-3 Board
The screen behind Meridian's counter shows a podium: the three best days of the run, biggest at the top, so the staff can see what there is to beat. The board is always three lines tall whether the run covers a week or a season, and no two days in a run ever tie.
Task: Print the three largest counts, biggest first.
Input
The first line holds an integer n, always at least 3. Each of the next n lines holds one day's cup count. No two counts are equal.
Output
Exactly three lines, each with one digit after the decimal point, running from the largest down to the third largest. A run of exactly three days still prints three lines — the whole run, reordered.
Example:
Input:
4
5
1
9
7
Output:
9.0
7.0
5.0
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