#K49547. Winner of the Dice Game
Winner of the Dice Game
Winner of the Dice Game
In this problem, you are given a series of rounds in a dice game. In each round, two dice are rolled and their values are added together. The round with the highest total sum is considered the winning round. If multiple rounds have the same highest sum, the first occurrence is the winner. If there are no rounds, the result is 0.
The sum in each round is calculated as (a + b), where (a) and (b) are the values on the two dice. Your task is to identify the 1-indexed round number in which the winning score occurred.
inputFormat
The input is given via standard input (stdin). The first line contains an integer (n) representing the number of rounds. Each of the next (n) lines contains two space-separated integers (a) and (b), which are the dice values for that round.
outputFormat
Output a single integer to standard output (stdout) representing the 1-indexed round number where the highest sum occurred. If there are no rounds (i.e., (n = 0)), output 0.## sample
4
3 4
5 6
6 6
6 8
4
</p>