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

11597번 - Excellence 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 256 MB42230626672.283%

문제

The World Coding Federation is setting up a huge online programming tournament of teams comprised of pairs of programmers. Judge David is in charge of putting teams together from the Southeastern delegation. Every student must be placed on exactly one team of two students. Luckily, he has an even number of students who want to compete, so that he can make sure that each student does compete. However, he’d like to maintain his pristine reputation amongst other judges by making sure that each of the teams he fields for the competition meet some minimum total rating. We define the total rating of a team to be the sum of the ratings of both individuals on the team.

Help David determine the maximum value, X, such that he can form teams, each of which have a total rating greater than or equal to X.

입력

The first line of input contains a single positive integer n (1 ≤ n ≤ 105 , n is even), the number of students who want to enter the online programming tournament. Each of the following n lines contains one single integer si (1 ≤ si ≤ 106), the rating of student i.

출력

Print, on a single line, the maximum value, X, such that David can form teams where every team has a total rating greater than or equal to X.

제한

예제 입력 1

4
1
2
3
5

예제 출력 1

5

예제 입력 2

2
18
16

예제 출력 2

34

예제 입력 3

4
13
12
19
14

예제 출력 3

27

힌트

출처

ICPC > Regionals > North America > Pacific Northwest Regional > 2015 Pacific Northwest Region Programming Contest > Division 1 E번

ICPC > Regionals > North America > Pacific Northwest Regional > 2015 Pacific Northwest Region Programming Contest > Division 2 Q번

ICPC > Regionals > North America > Southeast USA Regional > 2015 Southeast USA Regional Programming Contest > Division 2 D번

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

출처

대학교 대회

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

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