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

23542번 - IQ 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 64 MB87807293.506%

문제

2ドルn$ newbie students came to competitive programming practice. Each student is characterized by his IQ level: the $i$-th student has IQ $a_i$.

The coach wants to break students up into teams of two people. Each team is characterized by a team IQ that is equal to the sum of the team members IQ levels. For example, if a team is formed from students $i$ and $j,ドル the team IQ is $a_i + a_j$. One team is stronger than the other if its team IQ is greater.

By the coach's opinion, practice will be much more productive if the difference between team IQs of the strongest and the weakest team is as small as possible. Help the coach determine the minimum value $A$ for which it is possible to form teams in such a way that difference of team IQs between the strongest and the weakest team is equal to $A$.

입력

The first line contains integer $n$ (1ドル \le n \le 100$).

The second line contains 2ドルn$ integers, the $i$-th of which is equal to the IQ of the $i$-th student $a_i$ (1ドル \le a_i \le 200,ドル 1ドル \le i \le 2n$).

출력

Output the minimum value $A$ for which the forming of teams is possible.

제한

예제 입력 1

3
100 100 89 140 102 150

예제 출력 1

38

힌트

출처

Contest > Open Cup > 2018/2019 Season > Stage 20: Grand Prix of Ural I번

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

출처

대학교 대회

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

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