Tournament
면접 대비시간 제한1초메모리 제한1024 MB
홀수 개의 실력 값이 주어질 때 한 학생을 진행자로 빼고 나머지를 짝지어 짝 합의 최댓값과 최솟값 차이를 최소로 만든다.
문제
The linguistic game "Hat" is played by several pairs of players. Also there should be one host of the game.
A teacher plans to organize a "Hat" tournament in their class consisting of students, where is odd number. In order to do this he wants to split students into pairs and leave one student to be the host.
Number students from to . Student number is known to have a skill value of in the "Hat" game. Skill of a pair of students is defined as the sum of their individual skills.
In order for the tournament to be as fair as possible the teacher wants the difference between the maximum and minimum skills of resulting pairs to be as small as possible. Help the teacher to choose the host and split other students into pairs in order to achieve the desired goal.
입력
The first line of input contains an integer --- the number of students in the class (, is guaranteed to be odd).
The second line contains integers ().
출력
Output one number --- the smallest possible difference between maximum and minimum skills of pairs participating in the tournament.