#abc109c. [abc109_c]Skip
[abc109_c]Skip
Problem Statement
There are cities on a number line. The -th city is located at coordinate .
Your objective is to visit all these cities at least once.
In order to do so, you will first set a positive integer .
Then, you will depart from coordinate and perform Move and Move below, as many times as you like:
- Move : travel from coordinate to coordinate .
- Move : travel from coordinate to coordinate .
Find the maximum value of that enables you to visit all the cities.
Here, to visit a city is to travel to the coordinate where that city is located.
Constraints
- All values in input are integers.
- are all different.
Input
Input is given from Standard Input in the following format:
Output
Print the maximum value of that enables you to visit all the cities.
Sample Input 1
3 3
1 7 11
Sample Output 1
2
Setting enables you to visit all the cities as follows, and this is the maximum value of such .
- Perform Move to travel to coordinate .
- Perform Move to travel to coordinate .
- Perform Move to travel to coordinate .
- Perform Move to travel to coordinate .
- Perform Move to travel to coordinate .
- Perform Move to travel to coordinate .
Sample Input 2
3 81
33 105 57
Sample Output 2
24
Sample Input 3
1 1
1000000000
Sample Output 3
999999999