#abc064b. [abc064_b]Traveling AtCoDeer Problem
[abc064_b]Traveling AtCoDeer Problem
Problem Statement
It is only six months until Christmas, and AtCoDeer the reindeer is now planning his travel to deliver gifts.
There are houses along TopCoDeer street. The -th house is located at coordinate . He has decided to deliver gifts to all these houses.
Find the minimum distance to be traveled when AtCoDeer can start and end his travel at any positions.
Constraints
- is an integer.
Input
Input is given from Standard Input in the following format:
Output
Print the minimum distance to be traveled.
Sample Input 1
4
2 3 7 9
Sample Output 1
7
The travel distance of can be achieved by starting at coordinate and traveling straight to coordinate .
It is not possible to do with a travel distance of less than , and thus is the minimum distance to be traveled.
Sample Input 2
8
3 1 4 1 5 9 2 6
Sample Output 2
8
There may be more than one house at a position.