#d1506. 体育节
体育节
Sports Festival
Problem Description
The student union is preparing for the relay race of the sports festival. The student union consists of members who will run one by one in the race. The -th person has speed . The -th leg of the relay produces a difference value , which equals the difference between the maximum and minimum speeds among the first participants — that is, if we denote the speed of the -th participant as , then $d_i = \max(a_1, a_2, \dots, a_i) - \min(a_1, a_2, \dots, a_i)$.
You may arrange the running order of the participants arbitrarily. Each person participates exactly once and everyone must participate. Find the minimum possible value of .
Input Format
The first line contains a positive integer . The second line contains integers representing .
Output Format
Output one integer, the answer.
Sample Input
3
3 1 2
Sample Output
3
Constraints
,