Logo
(追記) (追記ここまで)

31949번 - Arrested Development 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 (추가 시간 없음) 2048 MB (추가 메모리 없음)177796859.130%

문제

You are now in charge of two programming interns, and you must develop a large system. There are a number of tasks that need to be completed by the end of the summer. You know how long each intern will take to complete each task, in minutes.

Compute the minimum number of minutes it will take to complete all tasks for development of the system, assuming that the two interns are the only developers, that they work independently and concurrently, that they do not share tasks, and that the amount of time it takes an intern to complete all their tasks is the sum of the number of minutes it takes to do each task one after the other.

입력

The first line of input contains a single integer $n$ (1ドル \le n \le 50$), which is the number of tasks.

Each of the next $n$ lines contains two integers $a$ and $b$ (1ドル \le a,b \le 10^5$). Each line represents a single task, where $a$ is the number of minutes it will take the first intern to complete the task, and $b$ is the number of minutes it will take the second intern to complete the task.

출력

Output a single integer, which is the minimum number of minutes needed to complete the development project.

제한

예제 입력 1

4
100 1
1 90
1 20
1 20

예제 출력 1

3

예제 입력 2

2
314 1
592 6

예제 출력 2

7

힌트

출처

ICPC > Regionals > North America > North America Championship > North America Championship 2024 A번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /