In a cricket match, there are two teams, each comprising 1111 players. The scorecard of the match lists the runs scored and wickets taken by each of these 2222 players.

To determine the “Man of the Match”, we assess each player’s performance. Points are awarded to a player as follows:

- Each run scored earns 11 point.
- Every wicket taken earns 2020 points.

The player with the **highest total points** is awarded the “Man of the Match” title.

You are given the scorecard of a cricket match, listing the contributions of all 2222 players.

The players are numbered from 11 to 2222. Find the “Man of the Match”.

It is guaranteed that for all inputs to this problem, the “Man of the Match” is **unique**.

**Note**: A player who belongs to the losing team can also win the “Man of the Match” award.

### Input Format

- The first line of input will contain a single integer ï¿½
*T*, denoting the number of test cases. - Each test case consists of 2222 lines of input. The ï¿½
*i*-th of these 2222 lines contains two space-separated integers ï¿½ï¿½*A**i*â€‹ and ï¿½ï¿½*B**i*â€‹ â€” respectively, the runs scored and wickets taken by the ï¿½*i*-th player.

### Output Format

For each test case, output on a new line a single integer ï¿½*i* (1â‰¤ï¿½â‰¤22)(1â‰¤*i*â‰¤22) denoting the *index* of the player with the maximum score.

The tests for this problem are designed such that there will be exactly one player with the maximum score.

### Constraints

- 1â‰¤ï¿½â‰¤10001â‰¤
*T*â‰¤1000 - 0â‰¤ï¿½â‰¤2000â‰¤
*A*â‰¤200 - 0â‰¤ï¿½â‰¤100â‰¤
*B*â‰¤10 - There will be exactly 11 player with the maximum score.

```
#include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int t;
cin >> t;
while (t>0) {
int n, m, high=0, res=0;
for (int i=1; i<23; i++) {
cin >> n >> m;
int temp = n + m*20;
if (temp>high) {
high=temp;
res=i;
}
}
cout << res << endl;
t--;
}
}
```

## Leave a Reply