Which Day Sold the Most?
Riverbend Supply's weekly review names the busiest and the quietest trading day so that next week's roster can be shifted towards the busy end. The meeting wants to know which day, not how much was taken — the takings themselves are already printed further down the sheet. Days are numbered from 0 in the order they are listed. If two days tie for busiest, the earlier of them is named, and the same rule settles a tie for quietest.
Task: Print the position of the busiest day, then the position of the quietest.
Input
The first line holds a single integer n, the number of days. Each of the next n lines holds one day's takings, which may carry decimals.
Output
Two lines. The busiest day's position on the first line, the quietest day's position on the second. Count positions from 0, so the first day listed sits at position 0.
Example:
Input:
4
50
90
30
70
Output:
1
2
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