Which Team Should Receive the Sponsor Prize?
Time limit8sMemory limit1024 MB
For each dataset, find the team whose elapsed time is closest to 2023 seconds and print its team number.
- Level
Easy2 of 10
- Topics
- Implementation, Array
- Solved
- No attempts yet
Problem
In ICQC (International Collegiate Quiz Contest), teams compete on how fast they can answer a difficult quiz. The winner is, of course, the team that gives the correct answer first. This year, a sponsor prize also goes to the team whose correct answer time is closest to seconds after the contest starts.
Given the elapsed time from the start of the contest until each team gave its correct answer, decide which team receives the sponsor prize.
Input
The input consists of multiple datasets. Each dataset is given in the following format. There are at most datasets.
is the number of participating teams, where . The teams are numbered through . () is the elapsed time in seconds before team gave its correct answer. It is a positive integer not exceeding . You may assume that exactly one team has the elapsed time closest to seconds.
The end of the input is a line containing a single .
Output
For each dataset, print the number of the team that receives the sponsor prize on its own line.