프로그램 명: coci_mali
제한시간: 1 초

Mirko and Slavko are playing a new game. Again. Slavko starts each round by giving Mirko two numbers A and B, both smaller than 100. Mirko then has to slove the following task for Slavko: how to pair all given A numbers with all given B numbes so that the maximal sum of such pairs is as small as possible.

In other words, if during previous rounds Slavko gave numbers a1, a2, a3 .... an and b1, b2, b3 ... bn, determine n pairings (ai, bj) such that each number in A sequence is used in exactley one pairing, and each number in B sequenct is used in exactely one pairing and the maximum of all sums ai + bj is minimal.

입력

출력

Output consists of N lines, one for each round. Each line should contain the smallest maximal sum for that round.

입출력 예

input

3
2 8
3 1
1 4

output

10
10
9

input

3
1 1
2 2
3 3

output

2
3
4
출처: coci 2009/2010 contest1 4/6

[질/답] [제출 현황] [푼 후(0)]
[ 채 점 ] [홈으로]  [뒤 로]