Given each participant's initial score and the time they spend solving problems, find who has the highest score at the end.
There are participants in a contest. For each participant, you are given:
A participant's final score is computed from these values in the order described by the problem. Your task is to determine which participant has the best result after all calculations are applied, and output their index.
If multiple participants achieve the same best result, the earlier participant should be preferred.
Example 1
Input
3 10 5 20 12 4 18 9 7 25
Output
2
Explanation
After evaluating the participants, the second participant has the highest final score, so the answer is 2.
Premium problem context
Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.