Problem:


Score : 200 points

Problem Statement

A group of people played a game. All players had distinct scores, which are positive integers.

Takahashi knows N facts on the players' scores. The i-th fact is as follows: the A_i-th highest score among the players is B_i.

Find the maximum possible number of players in the game.

Constraints

1 \leq N \leq 10^5

1 \leq A_i \leq 10^9(1\leq i\leq N)

0 \leq B_i \leq 10^9(1\leq i\leq N)

If i ≠ j, A_i ≠ A_j.

There exists a possible outcome of the game that are consistent with the facts.

All input values are integers.

Inputs

Input is given from Standard Input in the following format:

N
A_1 B_1
:
A_N B_N

Outputs

Print the maximum possible number of players in the game.

Sample Input 1

3
4 7
2 9
6 2

Sample Output 1

8

The maximum possible number of players is achieved when, for example, the players have the following scores: 12,9,8,7,5,2,1,0.

Sample Input 2

5
1 10
3 6
5 2
4 4
2 8

Sample Output 2

7

Sample Input 3

2
1 1000000000
1000000000 1

Sample Output 3

1000000001



Sample input:
3
4 7
2 9
6 2


Sample output:
8

Submission status: Accepted

Solution code:
num = int(input())

tensuu = [[int(x) for x in input().split()] for i in range(num)]

tensuu.sort(key = lambda x:x[1])

print(tensuu[0][0] + tensuu[0][1])

Submission status: Accepted

Solution code:
import sys

import numpy as np

a = []
b = []

n = int(sys.stdin.readline().strip())

for i in range(n):
    ai, bi = map(int, sys.stdin.readline().strip().split())
    a.append(ai)
    b.append(bi)

l = np.argmax(a)
print(a[l]+b[l])

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 回数N
N = int(input())
# 最低人数とポイント
num_temp = 0
num_point = 0
# 最低人数を探す
for n in range(N):
    num , point = map(int, input().split())
    if num_temp < num:
        num_temp = num
        num_point = point
# 最低人数+ポイント=参加人数のありうる最大値
print(num_temp + num_point)

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    N = input()
    d = []
    for _ in xrange(N):
        A, B = map(int, raw_input().split())
        d.append((A,B))
    
    d.sort()

    A1, B1 = d[0]
    AN, BN = d[-1]

    print AN + BN

Submission status: Accepted

Solution code:
#! -*- coding:utf-8 -*-

n = int(input())

a = []
b = []
for i in range(n):
    x,y = map(int,input().split())
    a.append(x)
    b.append(y)

x = min(a)
y = min(b)

a.sort()
b.sort(reverse = True)

print(a[-1] - a[0] + a[0] + b[-1])

Submission status: Accepted

Solution code:
N = int(input())
worst = [None, None]
for i in range(N):
    A, B = list(map(int, input().split()))
    if worst[0] == None or worst[0] < A:
        worst = [A, B]

print(worst[0] + worst[1])

Submission status: Accepted

Solution code:
n=int(input())

max=0
for i in range(n):
    a,b=map(int,input().split())
    if a>max: max=a; ans=a+b

print(ans)

Submission status: Accepted

Solution code:
all = input()
num = 0
score = 0
for i in range(int(all)):
	now = input().split()
	if int(now[0]) > num:
		num = int(now[0])
		score = int(now[1])
print(num + score)

Submission status: Accepted

Solution code:
n = int(input())
max_a = 0
max_b = 0
for i in range(n):
    a,b = map(int,input().split())

    if a > max_a:
        max_a,max_b = a,b
         
print(max_b+max_a)

Submission status: Accepted

Solution code:
N = int(input())
arr = [[0 for i in range(2)] for _ in range(N)]

for n in range(N):
    arr[n] = list(map(int, input().split()))
    
arr.sort(key=lambda x:x[0])
max_order = arr[0][0]
min_order = arr[N-1][0]
min_score = arr[N-1][1]

print(max_order + (min_order-max_order) + min_score)

Submission status: Accepted

Solution code:
def read_int_list():
    return list(int(i) for i in input().split())
n = int(input())
player = dict()
for i in range(n):
    k, p = read_int_list()
    player[k] = p

max_p = max(player)
min_p = min(player)
high = min_p - 1
low = player[max_p]
b = max_p-min_p+1
print(high+b+low)

Submission status: Accepted

Solution code:
l=int(input())
a=[0 for i in range(l)]
b=[0 for i in range(l)]
for i in range(l):
    a[i],b[i]=list(map(int,input().split(' ')))

la=max(a)
sa=min(a)
sb=min(b)

s=sa-1
m=la-sa+1
l=sb
print(s+m+l)

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    AB = {tuple(map(int, input().split())) for _ in range(N)}

    print(sum(max(AB)))

main()

Submission status: Accepted

Solution code:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

N = int(input())
a_list = []
b_list = []

for i in range(N):
	A,B = map(int,input().split(" "))

	a_list.append((A,B))

a_list.sort()

print(a_list[-1][1] + a_list[-1][0])

Submission status: Accepted

Solution code:
N = int(input())
a = []
b = []


for i in range(N):
    tmp_a, tmp_b = map(int, input().split())
    a.append(tmp_a)
    b.append(tmp_b)

ans = max(a)
max_ind = a.index(ans)
ans += b[max_ind]
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
m_rank = 1
point_at_m_rank = 1000000000
for i in range(N):
    a, b = map(int, input().split())
    if a >= m_rank:
        m_rank = a
        point_at_m_rank = b
print(m_rank+abs(point_at_m_rank))

Submission status: Accepted

Solution code:
n = int(input())
arr = [list(map(int,input().split())) for i in range(n)]
a = max(arr)[0]
b = max(arr)[1]
print(a + b)

Submission status: Accepted

Solution code:
N = int(input())
A = []
B = []

for _ in range(N):
    line = input().split()
    A.append(int(line[0]))
    B.append(int(line[1]))
print(max(A) + B[A.index(max(A))])

Submission status: Accepted

Solution code:
N = int(input())
A = []
B = []
for i in range(N):
    temp = input().split()
    A.append(int(temp[0]))
    B.append(int(temp[1]))

idx = A.index(max(A))
print(A[idx] + B[idx])

Submission status: Accepted

Solution code:
n = int(input())

a = [list(map(int, input().split())) for x  in range(n)]
print(max(a, key=lambda x: x[0])[0] + min(a, key=lambda x: x[1])[1])

Submission status: Accepted

Solution code:
N = int(input())
best_rank = 1000000000
best_score = 0
worst_rank = 0
worst_score = 0
for i in range(N):
    a, b = list(map(int, input().split()))
    if a < best_rank:
        best_rank, best_score = a, b
    if a > worst_rank:
        worst_rank, worst_score = a, b

print(worst_score+worst_rank)

Submission status: Accepted

Solution code:
def i1():
 return int(input())
def i2():
 return [int(i) for i in input().split()]

n=i1()
x=[]
for i in range(n):
    x.append(i2())
x.sort()
print(x[-1][0]+x[-1][1])

Submission status: Accepted

Solution code:
N = int(input())
AB = [tuple(map(int,(input().split()))) for i in range(N)]
AB = sorted(AB,reverse=True)
print(AB[0][0]+AB[0][1])

Submission status: Accepted

Solution code:
N = int(input())
a_b = []
for i in range(N):
    a_b.append(list(map(int, input().split())))
a_b.sort()
print(a_b[-1][0] + a_b[-1][1])

Submission status: Accepted

Solution code:
N=int(input())
maxx=0
maxy=0

for i in range(N):
    x = list(map(int, input().split()))
    if maxx<x[0]:
        maxx=x[0]
        maxy=x[1]


print(maxx+maxy)

Submission status: Accepted

Solution code:
n = int(input())
rank_point =[ ]
for _ in range(n):
    rank_point.append(list(map(int,input().split())))

rank_point = sorted(rank_point, key = lambda x:x[0])
print(sum(rank_point[-1]))

Submission status: Accepted

Solution code:
n = int(input())

num_list = []
for i in range(n):
    a, b = map(int, input().split())
    num_list.append([a, b])
num_list.sort(reverse=True)
a, b = num_list[0]
print(a + b)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
http://tenka1-2017-beginner.contest.atcoder.jp/tasks/tenka1_2017_b

"""
import sys
from sys import stdin
input = stdin.readline


def main(args):
    worst_rank = -1
    worst_score = float('inf')

    N = int(input())
    for _ in range(N):
        r, s = map(int, input().split(' '))
        if r > worst_rank:
            worst_rank = r
            worst_score = s

    print(worst_rank + worst_score)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

Solution code:

N = int(input())
info = [list(map(int,input().split())) for i in range(N)]

info.sort(reverse=True)
print(info[0][0]+info[0][1])

Submission status: Accepted

Solution code:
import sys

n = int(input().strip())
a_, b_ = 0, 0
for _ in range(n):
    a, b  = [int(x) for x in input().strip().split()]
    if a_ < a:
        a_, b_ = a, b
print(a_ + b_)

Submission status: Accepted

Solution code:
n = int(input())
ans = 10**10
for i in range(n):
    a,b = map(int,input().split())
    ans = min(ans,(a+b))
print(ans)

Submission status: Accepted

Solution code:

n = int(input())
amax = 0
b_amax = 0
for i in range(n):
  (a, b) = tuple([int(i) for i in input().split()])
  if amax < a:
    amax = a
    b_amax= b
print(amax + b_amax)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

N = int(input())
A = []
B = []
for i in range(N):
    a,b = map(int, input().split())
    A.append(a)
    B.append(b)

max_order = max(A)
i = A.index(max_order)
score = B[i]
print(max_order+score)

Submission status: Accepted

Solution code:
# coding: utf-8
# Here your code !
N = int(input())

aMax = 0
bMax = 0
for i in range(N) :
    s = input().split()
    a = int(s[0])
    b = int(s[1])
    
    #aが最大のindexを保存しておきたい
    if a > aMax :
        aMax = a
        bMax = b
        
print(aMax + bMax)

Submission status: Accepted

Solution code:
#!usr/bim/python
#! -*- coding: utf-8 -*-

n = raw_input()
n = int(n)

maxa = 0

for i in range(n):
    ab = raw_input()
    ab = ab.split()
    a,b = map(int,ab)
    if a > maxa:
        maxa = a
        minb = b

ans = maxa + minb

print ans

Submission status: Accepted

Solution code:
N = int(input())

m1 = 0
m2 = 0
for i in range(N):
    a, b = map(int, input().split())
    if a > m1:
        m1 = a
        m2 = b

print(m1 + m2)

Submission status: Accepted

Solution code:
n = int(input())
ab = [list(map(int, input().split())) for i in range(n)]

c = 0
d = 0

for i in range(n):
    if c < ab[i][0]:
        c = ab[i][0]
        d = ab[i][1]

print(c+d)

Submission status: Accepted

Solution code:
N = int(input())
ans = [-1, 0]

for i in range(N):
    A, B = map(int, input().split())
    if ans[0] < A:
        ans[0] = A
        ans[1] = B

print(sum(ans))

Submission status: Accepted

Solution code:
N = int(input())

A = []
B = []

for _ in range(N):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)
    
print(B[A.index(max(A))]+max(A))

Submission status: Runtime Error

Solution code:
n=int(input())
ans=10**100
for i in range(n)
  t=sum(list(map(int,input().split())))
  ans=min(ans,t)
print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())
ans=10*100
for i in range(n)
  ans=min(ans,sum(list(map(int,input().split()))))
print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())
ans=10*100
for i in range(n)
  ans=min(ans,sum(map(int,input().split())))
print(ans)

Submission status: Runtime Error

Solution code:
print(min([int(input()) for _ in [0]*int(input())],key=lambda x:x[0]+x[1]))

Submission status: Runtime Error

Solution code:
N=int(input())
AB=[]
for i in range(N):
    AB.append(list(map(int,input().split())))
a=AB[0][1]
for i in range(N-1):
    if AB[i+1][1]<AB[i][1]:
        a=AB[i+1][1]
        b=i+1
print(a+AB[b][0])

Submission status: Runtime Error

Solution code:
N=int(input())
AB=[]
for i in range(N):
    AB.append(list(map(int,input().split())))
A=[]
B=[]
for i in range(N):
    A.append(AB[i][0])
    B.append(AB[i][1])
for i in range(N):
    if B[i]==max(B):
        bmax=i
    elif B[i]==min(B):
        bmin=i
print(A[bmin]+B[bmin])

Submission status: Runtime Error

Solution code:
n = int(input())
a_list = []
b_list = []
for _ in range(n):
    a, b = map(int, input().split())
    a_list.append(a)
    b_list.append(b)

maximum = 0
for i in a_list:
    if maximum < i:
        maximum = i
index = a_list.index(maximum)
score = b_list[index]
max = maximum + score

ans_list = [0]*max
print(len(ans_list))

Submission status: Runtime Error

Solution code:
n = int(input())
a_list = []
b_list = []
for _ in range(n):
    a, b = map(int, input().split())
    a_list.append(a)
    b_list.append(b)

maximum = 0
for i in a_list:
    if maximum < i:
        maximum = i
index = a_list.index(maximum)
score = b_list[index]
maximum = maximum + score

ans_list = [0]*maximum
print(len(ans_list))

Submission status: Runtime Error

Solution code:
N = int(input())
M = 0
m = 10**9
c = 0
for i in range(N):
  a,b = map(int.input().split())
  if m >= a:
    m = a
  if M < a:
    M = a
    c = b + 1
print(c+m-M)

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>
#include <stack>
#include <functional>

#ifdef LOCAL
    #define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
    #define eprintf(...) 42
#endif

#define rep_(i, a_, b_, a, b, ...) for (int i = (a), i##_len = (b); i < i##_len; ++i)
#define rep(i, ...) rep_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define reprev_(i, a_, b_, a, b, ...) for (int i = (b-1), i##_min = (a); i >= i##_min; --i)
#define reprev(i, ...) reprev_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define all(x) (x).begin(), (x).end()
template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }
#define fls(x) (64 - __builtin_clzll(x))
#define pcnt(x) __builtin_popcountll(x)
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int,int> P;
typedef long double ld;

int main (void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    vector<P> a(n);
    for (auto &e : a) cin >> e.first >> e.second;
    sort(all(a)); reverse(all(a));
    cout << n + a[0].second << "\n";
    return 0;
}

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
from collections import deque, Counter
from heapq import heappop, heappush
from bisect import bisect_right

def main():
    N = int(input())
    A = [None] * N
    B = [None] * N
    for i in range(N):
        A[i], B[i] = map(int, input().split())
    print(max(A[i])+B.index(max(A[i])))

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
N = int(input())
if(N == 1):
  A1,B1 = map(int,input().split())
  print(str(A1+B1))
for i in range(N-1):
  if(i == 0):
    A1,B1 = map(int,input().split())
    A2,B2 = map(int,input().split())
    if(A1 <= A2):
      MA = A2
      MB = B2
    else:
      MA = A1
      MB = B1
    A1 = A2
    B1 = B2
  else:
    A2,B2 = map(int,input().split())
    if(MA <= A2):
      MA = A2
      MB = B2
    A1 = A2
    B1 = B2
print(str(MA + MB))

Submission status: Runtime Error

Solution code:
n = int(input())
A = [map(int,input().split()) for _ in range(n)]
A.sort(key=lambda x: x[0])
most = A[0][0]
mos = A[0][1]
worst = A[-1][0]
wors = A[-1][1]
print((most-1)+(most-worst+1)+(wors+1))

Submission status: Runtime Error

Solution code:
n = int(input())
A = [a,b = map(int,input().split()) for _ in range(n)]
A.sort(key=lambda x: x[0])
most = A[0][0]
mos = A[0][1]
worst = A[-1][0]
wors = A[-1][1]
print((most-1)+(most-worst+1)+(wors+1))

Submission status: Runtime Error

Solution code:
n=int(input())
a=sorted(list(map(int,input().split())) for _ in range(n))
print(sum(a[-1])

Submission status: Runtime Error

Solution code:
n = int(input())
A = []
B = []
for i in range(n):
  a, b = map(int,input().split())
  A.append(a)
  B.append(b)
print(max(a)+min(b))

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

int main() {
	int N;
	cin >> N;
	int A_max = 0;
	int last_B = 0;
	for (int i = 0; i < N; i++) {
		int a, b = 0;
		cin >> a >> b;
		if (a > A_max) {
			A_max = a;
			last_B = b;
		}
	}
	cout << A_max + last_B << endl;
}

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <cmath>

using namespace std;
#define PI 3.1415926535897932384626433832795
#define MOD (1000000007)
#define EPS (1e-15)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repc(i, s, n) for (int i = (s); i <= (n); i++)
#define rrep(i, n) for (int i = (n) - 1; i >= 0; i--)
#define rrepc(i, s, n) for (int i = (s); i >= (n); i--)
#define bet(x, a, b) (a) <= (x) && (x) < (b)
typedef long long ll;
typedef unsigned long long ull;

pair<int, int> AB[100000];

int main()
{
	int N;

	cin >> N;
	rep(i, N) cin >> AB[i].first >> AB[i].second;

	sort(AB, AB + N, greater<pair<int, int> >());

	cout << (ll)AB[0].first + (ll)AB[0].second << endl;

	return 0;
}

Submission status: Runtime Error

Solution code:
N = int(input())

maxi = -1
sc = 0

for i in range(N):
	A, B = map(int, input().split())
	if A > mini:
		mini = A
		sc = B
print(mini + sc)

Submission status: Runtime Error

Solution code:
from operator import itemgetter


n = int(input())
info = [list(map(int, input().split())) for i in range(n)]

info = sorted(info, key = itemgetter(1))
print(info[0][0] + info[0][])

Submission status: Runtime Error

Solution code:
n=int(input())
a=[list(map(int,input().split())) for i in range(N)]
a.sort()
print(sum(a[0]))

Submission status: Runtime Error

Solution code:
# tenka1-2017-beginnerB - Different Distribution
def main():
    N, *AB = map(int, open(0).read().split())
    A = [sum(i, j) for i, j in zip(*[iter(AB)] * 2)]
    ans = max(A)
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
# tenka1-2017-beginnerB - Different Distribution
def main():
    N, *AB = map(int, open(0).read().split())
    A = [sum(i, j) for i, j in zip(*[iter(AB)] * 2)]
    ans == max(A)
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
N,*A=map(int,open(0).read().split())
i=2*sorted(enumerate(A[::2]),lambda x:x[1])[-1][0]
print(A[i]+A[i+1])

Submission status: Runtime Error

Solution code:
maxx = 0
maxxx = 0
count = 0
x=[]
y=[]
s = input()
for i in range(s):
    x1,y1=[int(i) for i in input().split()]
    x.append(x1)
    y.append(y1)
for item in x:
    if maxx < item:
        maxx = item
        maxxx = y[count]
    count = count + 1
print(maxx +maxxx)

Submission status: Runtime Error

Solution code:
s = int(input())
z = {}
maxx = 0
maxxx = 0
for i in range(s):
    x1,y1=[int(i) for i in input().split()]
    z[x1]=y1
for key,value in z.items():
    if maxx < key:
        maxx = item
        maxxx = key
print(maxx +maxxx)

Submission status: Runtime Error

Solution code:
s = int(input())
z = {}
maxx = 0
maxxx = 0
for i in range(s):
    x1,y1=[int(i) for i in input().split()]
    z.[x1]=y1
for key, value in z.items():
    if maxx < key:
        maxx = item
        maxxx = key
print(maxx +maxxx)

Submission status: Runtime Error

Solution code:
s = int(input())
z = {}

maxx = 0
for i in range(s):
    x1,y1=[int(i) for i in input().split()]
    x.append(x1)
for item in x:
    if maxx < item:
        maxx = item
print(maxx +2)

Submission status: Runtime Error

Solution code:
z = {}
maxxx = 0
count = 0
county = 0
for i in range(s):
    x1,y1=[int(i) for i in input().split()]
    z[x1] = y1
for key,value in z.items():
    if maxxx < key:
        maxxx = key
        county = value
print(maxxx+2)

Submission status: Runtime Error

Solution code:
N = int(input())
e = [[int(i) for i in input().split()] for i in range(N)]
mar=e[0][0]
mir=e[0][0]
mav=0
miv=0
mv=0
mmv=e[i][1]
for i in range(N):
    if e[i][0] > mar:
        mar =e[i][0]
        mmv=e[i][1]
print(mar+mmv)

Submission status: Runtime Error

Solution code:
n = int(input())
a,b = [],[]
for i in range(n):
    ta,tb = map(int, input().split())
    a.append(ta)
    b.append(tb)
mai = a[b.index(max(b))]
mii = a[index(min(b))]
print(mii+(min(b))+mai-1)

Submission status: Runtime Error

Solution code:
n = int(input())
a,b = [],[]
for i in range(n):
    ta,tb = map(int, input().split())
    a.append(ta)
    b.append(tb)
mai = a.index(max(b))
mii = a.index(min(b))
print(mii+(min(b))+mai-1)

Submission status: Runtime Error

Solution code:
n = int(input())
A = [None] * n
B = [None] * n
for i in range(n):
    A[i], B[i] = list(map(int, input().split()))

print(A[B.index(min_point)] + min(B))

Submission status: Runtime Error

Solution code:
n = int(input())
l = [list(map(int, input().split())) for _ in range(n)]
l.sort(key=lambda x:x[1])
print(x[0][0]+x[0][1])

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
typedef long long ll;
#define rep(i,m,n) for(ll i = (m); i < (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define print2(x,y) cout << (x) << " " << (y) << endl;
#define printa(x,n) for(ll i = 0; i < n; i++){ cout << (x[i]) << " \n"[i == n-1];}
#define printp(x,n) for(ll i = 0; i < n; i++){ cout << "(" << x[i].first << ", " << x[i].second << ") "; } cout << endl;
#define INF (1e18)
using namespace std;
const ll MOD = 1e9 + 7;
typedef pair<ll, ll> lpair;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N;
    ll A[100010], B[100010];
    cin >> N;
    rep(i,0,N) cin >> A[i] >> B[i];
    vector<lpair> lp;
    rep(i,0,N) lp.push_back(make_pair(A[i], B[i]));
    sort(lp.begin(), lp.end());
    print(lp[N-1].first + lp[N-1].second);
}

Submission status: Runtime Error

Solution code:
#n,*a=map(int,open(0).read().split())
b=[a[i]for i in range(0,len(a),2)]
c=[a[i]for i in range(1,len(a),2)]
print(max(b)+c[b.index(max(b))])

Submission status: Runtime Error

Solution code:
n,*a=map(int,open(0).read().split())
b=[a[i]for i in range(0,len(a),2)]
c=[a[i]for i in range(1,len(a),2)]
print(max(b)+c[c.index(max(b))*2+1])

Submission status: Runtime Error

Solution code:
n,*a=map(int,read(0).split())
b=max([a[i]for i in range(0,len(a),2)])
print(b+a[a.index(b)+1])

Submission status: Runtime Error

Solution code:

n = int(input())
temp = 0
ans = 0
for i in range(n):
    a,b = map(int,input().split(' '))
    if a > temp:
        ans = a + b
print ans

Submission status: Runtime Error

Solution code:
    maxx = 2**29
    ans = 0
    for _ in range(int(input())):
        a, b = map(int, input().split(' '))
        if b < maxx:
            maxx = b
            ans = a
    print(ans + maxx)

Submission status: Runtime Error

Solution code:
N = int(input())


grid = []
for i in range(N):
    array = list(map(int, input().strip().split(' ')))
    grid.append(array)

print (max(grid[0]) + min(grid[1])

Submission status: Runtime Error

Solution code:
n=int(input())
a=[0]*n
b=[0]*n
for i in range(n):
    a[i],b[i]=map(int,input().split())
y=max(a)
print(y+b[y])

Submission status: Runtime Error

Solution code:
n = int(input())
a =0
b =0
for i in range(n):
    nums = [int(num) for num in input().split]
    aa = nums[0]
    bb = nums[1]
    if aa > a:
        a = aa
        b = bb
print(a + b)

Submission status: Runtime Error

Solution code:
N = int(input())
print(min([sum(list(map(int,input().split()))) for j in range(N)])

Submission status: Runtime Error

Solution code:
N = int(input())
print(min(sum(list(map(int,input().split())))))

Submission status: Runtime Error

Solution code:
N = int(input())
print(min(sum(*map(int,input().split()))))

Submission status: Runtime Error

Solution code:
N = int(input())
print(min(sum(map(int,input().split()))))

Submission status: Runtime Error

Solution code:
from operator import add
n=int(input())
print(min(map(add, map(int, input().split())) for _ in range(n)))

Submission status: Runtime Error

Solution code:
def main():
    n = int(input())
    ab:[[int]] = []
    for i in range(n):
        ab.append([int(x) for x in input().split()])
    a, b = max(ab, key=lambda x: x[0])
    print(a + b)


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
n = int(input())

maxm = 0
num = -1

for i in range():
    a, b = map(int, input().split())
    if a > maxm:
        maxm = a
        num = b

print(maxm + num)

Submission status: Runtime Error

Solution code:
#!user/bin/env python
# coding:utf-8

n = int(input())
info = []

for i in range(n):
    ai = int(input())
    bi = int(input())
    info.append([ai, bi])

info = sorted(info, key=lambda inf: inf[1])

imp = info[0][0] + info[0][1]
print(imp)

Submission status: Runtime Error

Solution code:
N = int(input())
mn = 10**9 + 1
mx = 0
mnj = None
mxj = None
for i in range(N):
    Ai,Bi = map(int, input().split())
    if mn > Bi:
        mn = Bi
        mnj = Ai
    if mx < Bi:
        mx = Bi
        mxj = Ai
print(mxj + mnj - mxj + mn)

Submission status: Runtime Error

Solution code:
N = int(input())
ab = []
for i in range(N):
    ab.append(tuple(map(int,input.split())))
ans = N
mx = max(ab,key=lambda x:x[1])[0]
ans += mx - 1
mn = min(ab,key=lambda x:x[1])[1]
ans += mn
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
ab = []
for i in N:
    ab.append(tuple(map(int,input.split())))
ans = N
mx = max(ab,key=lambda x:x[1])[0]
ans += mx - 1
mn = min(ab,key=lambda x:x[1])[1]
ans += mn
print(ans)

Submission status: Runtime Error

Solution code:
n=i1()
x=[]
for i in range(n):
    x.append(i2())
x.sort()
print(x[-1][0]+x[-1][1])