100 atcoder#ABC109C. [ABC109C] Skip
[ABC109C] Skip
Score : points
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.
3 3
1 7 11
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 .
3 81
33 105 57
24
1 1
1000000000
999999999