#C3950. Highest Scoring Player
Highest Scoring Player
Highest Scoring Player
You are given several test cases. In each test case, you will be provided with multiple records, where each record contains a player ID and the score that player achieved in a game. Your task is to compute the cumulative score for each player and then determine the player with the highest cumulative score. In the event of a tie, select the player with the smallest ID.
The cumulative score for a player is given by the formula: $$score = \sum_{i=1}^{n} S_i$$ where $$S_i$$ represents the score in the ith game.
inputFormat
The input is read from standard input. The first line contains an integer T, the number of test cases. For each test case, the first line contains an integer N, representing the number of records. Each of the next N lines contains two space-separated integers: P (the player ID) and S (the score in that game).
outputFormat
For each test case, output a single line to standard output containing the player ID with the highest cumulative score.
## sample3
5
1 10
2 -5
1 5
3 20
2 10
3
4 15
4 -5
4 5
4
10 100
20 -50
20 150
10 -100
3
4
20
</p>