ICPC Provincial
시간 제한1초메모리 제한2048 MB
3N개의 실력 값을 N개의 세 명짜리 팀으로 나눌 때, 모든 팀의 중앙값 중 최솟값을 최대화한다.
문제
The University of INC (UOI) is participating in an ICPC Provincial Contest, a qualifier contest for the ICPC Regional Contest. UOI has students (numbered from to ) who are eager to participate in the contest. There will be teams, each consisting of exactly students. Each student can only be assigned to only one team.
As the coach of UOI, you know that student has a skill rating of . You define the strength of a team as the median of the skill ratings of its members.
In order to increase the chance for all UOI teams to qualify for the ICPC Regional Contest, you want to arrange the teams so that the strength of the weakest team is maximized. Determine the maximum strength of the weakest team.
입력
The first line consists of an integer ().
The second line consists of integers ().
출력
Output a single integer representing the maximum strength of the weakest team.