| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 2048 MB | 31 | 16 | 16 | 51.613% |
T1 Ashley is training for another programming contest on Brandon's Online Judge. Brandon's Online Judge still has the same feature which allows Ashley's coach, Tom, to load in a list of problems for Ashley to work on.
Tom has curated some problems for Ashley to work on. Each problem is parameterized by "implementation difficulty" and "thinking difficulty", both of which are positive integers. Ashley must solve them in order.
Ashley starts out with a given implementation skill and thinking skill level. Ashley can solve a problem if and only if her implementation skill level is greater than or equal to the implementation difficulty of the problem, and her thinking skill level is greater than or equal to the thinking difficulty of the problem. After solving a problem, exactly one of her implementation skill level and thinking skill level increases by $1$, and Ashley can pick which increases.
Compute the minimum possible sum of implementation and thinking skill levels that Ashley can start out with such that she can solve all the problems on Tom's list in order.
The first line contains a single integer $n$ ($1 \le n \le 50$).
The next $n$ lines each contain two integers, $i$ and $t$ $(1 \le i, t \le 10^9)$, representing the implementation and thinking difficulties of one of the problems on Tom's list.
The problems are presented in the order that Ashley must solve them.
Output a single integer, the minimum possible sum of implementation and thinking skill levels that Ashley can start out with such that she can solve all the problems on Tom's list in order.
3 4 4 5 1 1 5
8
3 4 4 1 6 6 1
10
2 33 33 34 34
67
ICPC > Regionals > North America > Pacific Northwest Regional > 2025 ICPC Pacific Northwest Regional > Division 1 L번
ICPC > Regionals > North America > Pacific Northwest Regional > 2025 ICPC Pacific Northwest Regional > Division 2 L번