#C11311. Winner Determination
Winner Determination
Winner Determination
Given the number of players and their game results in wins and losses, determine the winning player. The winner is decided first by the highest win/loss ratio, and in case of a tie, by the highest total number of games played.
The win/loss ratio is defined as follows:
$$\text{ratio} = \frac{\text{wins}}{\text{losses}}$$
If a player has \(\text{losses} = 0\), then their ratio is considered to be \(\infty\). The answer should be the 1-indexed position (i.e. counting starts from 1) of the winning player.
inputFormat
The first line of the input contains an integer \(n\), representing the number of players. Each of the next \(n\) lines contains two space-separated integers: the number of wins and the number of losses for that player.
outputFormat
Output a single integer which is the 1-indexed position of the winning player.
## sample3
7 3
4 2
5 1
3