Since beginning her university studies, Ava has been going to a nearby plaza for lunch. In order to maintain good eating habits throughout her university career, Ava has crafted a perfect dining strategy.
Ava began by eating at each of the restaurants (numbered through ) at the plaza and rating how much she enjoyed the food. Once she gathered all he ratings, she would only eat at the highest-rated restaurant. (If there is a tie, she eats at the lowest-numbered restaurant.) However, after a week of eating the same food, Ava realized she needs more variety in her diet. To fix this issue, she decided that eating at a restuarant would cause its rating to drop by a fixed amount, .
Armed with her dining strategy, Ava wonders where she will grab lunch on her last day of university, which is days away if she eats at exactly one restaurant per day.
The input will contain test cases. Each test case starts with three integers . The next line contains positive integers , where represents the rating of the restaurant at the plaza. Restaurants are numbered starting from .
For the first four test cases in the file, . For the first seven cases, .
For each test case, your program should output one integer representing the restaurant Ava will eat at on the day.
2 5 4 20 17 5 4 7 1 2 4 8 16 4 8 100 3 22 20 14
2 5 3
Note: Only cases are shown in this sample.
Educational Computing Organization of Ontario - statements, test data and other materials can be found at ecoocs.org