/
Time Limit: 2 sec / Memory Limit: 1024 MiB
配点 : 233 点
問題文
高橋君と青木君は、料理コンテストの審査員を務めています。このコンテストでは、 N 人の参加者がそれぞれ 1 つずつ料理を提出し、 2 人の審査員がすべての料理に対してそれぞれ点数をつけます。
参加者には 1 から N までの番号が振られています。高橋君が参加者 i の料理につけた点数を A_i、青木君が参加者 i の料理につけた点数を B_i とします。各点数は 1 以上 100 以下の整数です。
各参加者の最終スコアは、高橋君の点数と青木君の点数の合計 A_i + B_i で決まります。最終スコアが最も高い参加者が優勝です。最終スコアが最も高い参加者はちょうど 1 人であることが保証されます。
優勝者の参加者番号を求めてください。
制約
- 1 \leq N \leq 2 \times 10^5
- 1 \leq A_i \leq 100 (1 \leq i \leq N)
- 1 \leq B_i \leq 100 (1 \leq i \leq N)
- 入力はすべて整数である。
- 最終スコアが最も高い参加者はちょうど 1 人である。
入力
N A_1 B_1 A_2 B_2 \vdots A_N B_N
1 行目には、参加者の人数を表す整数 N が与えられる。続く N 行のうち i 行目には、参加者 i に対する高橋君の点数 A_i と青木君の点数 B_i が、スペース区切りで与えられる。
出力
最終スコアが最も高い参加者の番号を 1 行で出力せよ。
入力例 1
3 50 60 80 70 40 90
出力例 1
2
入力例 2
5 10 20 30 40 50 50 60 30 20 70
出力例 2
3
入力例 3
10 45 55 60 40 30 70 80 15 25 75 50 50 90 10 35 65 70 30 55 46
出力例 3
10
入力例 4
20 12 34 56 78 90 11 23 45 67 89 1 99 100 50 48 52 73 27 36 64 85 14 29 71 58 42 17 83 94 5 41 59 66 33 8 91 75 25 53 47
出力例 4
5
入力例 5
1 1 1
出力例 5
1
Score : 233 pts
Problem Statement
Takahashi and Aoki are serving as judges for a cooking contest. In this contest, N participants each submit one dish, and the two judges assign a score to every dish.
The participants are numbered from 1 to N. Let A_i be the score that Takahashi gives to participant i's dish, and B_i be the score that Aoki gives to participant i's dish. Each score is an integer between 1 and 100, inclusive.
Each participant's final score is determined by the sum of Takahashi's score and Aoki's score, A_i + B_i. The participant with the highest final score wins. It is guaranteed that there is exactly one participant with the highest final score.
Find the participant number of the winner.
Constraints
- 1 \leq N \leq 2 \times 10^5
- 1 \leq A_i \leq 100 (1 \leq i \leq N)
- 1 \leq B_i \leq 100 (1 \leq i \leq N)
- All inputs are integers.
- There is exactly one participant with the highest final score.
Input
N A_1 B_1 A_2 B_2 \vdots A_N B_N
The first line contains an integer N, representing the number of participants. Of the following N lines, the i-th line contains Takahashi's score A_i and Aoki's score B_i for participant i, separated by a space.
Output
Print the participant number with the highest final score on a single line.
Sample Input 1
3 50 60 80 70 40 90
Sample Output 1
2
Sample Input 2
5 10 20 30 40 50 50 60 30 20 70
Sample Output 2
3
Sample Input 3
10 45 55 60 40 30 70 80 15 25 75 50 50 90 10 35 65 70 30 55 46
Sample Output 3
10
Sample Input 4
20 12 34 56 78 90 11 23 45 67 89 1 99 100 50 48 52 73 27 36 64 85 14 29 71 58 42 17 83 94 5 41 59 66 33 8 91 75 25 53 47
Sample Output 4
5
Sample Input 5
1 1 1
Sample Output 5
1