Hide

Problem C
Snowed In

After its successful rainfall measurement campaign, the University of Chicago Weather Service is ready to undertake a new challenge: measuring snowfall. More specifically, each day a volunteer will take measurements of how deep the snow is at various points around campus. Each measurement is a non-negative integer. Given this information, we would like to compute the difference between the biggest and smallest depth observed.

Input

The input is composed of two lines. The first line contains a single positive integer $n$ ($1 \le n \le 100$) that specifies the number of measurements. The second line contains the measurements, each separated by a single space.

Output

You must print a single integer: the difference between the biggest and the smallest measurement in the dataset.

Sample Input 1 Sample Output 1
3
5 10 15
10
Sample Input 2 Sample Output 2
5
14 5 39 5 7
34

Please log in to submit a solution to this problem

Log in