#K93962. Maximum Railway Length
Maximum Railway Length
Maximum Railway Length
You are given n cities located on a straight line, where the coordinate of each city is provided. Your task is to determine the maximum length of railway track that can be built by connecting any two of these cities. In other words, find the difference between the city with the maximum coordinate and the city with the minimum coordinate.
Note: The input is given so that the first number is n (the number of cities) followed by n space-separated integers representing the coordinates of the cities. The answer is the subtraction of the smallest coordinate from the largest one. For any two cities at positions \(a\) and \(b\), the length of the railway track would be \(|a-b|\). In this problem, you need to output the maximum track length possible.
inputFormat
The first line contains an integer \(n\) representing the number of cities.
The second line contains \(n\) space-separated integers, each indicating the coordinate of a city.
outputFormat
Print a single integer which is the maximum railway length that can be built, i.e. the difference between the maximum and minimum city coordinates.
## sample5
1 3 7 9 13
12