~/algor $ cat problems/minmax-21-qiymatlar-oraligi
Range of values
Easy
1000 ms
128 MB
20%
A positive integer $N$ and a sequence of $N$ integers are given. Find the difference between the largest and the smallest numbers of the sequence.
Input
The first line contains a positive integer $N$. The next line contains $N$ integers $A_{i}$.
Output
One integer — the difference between the largest and the smallest numbers.
Note
$1 \le N \le 1000$
$-10^{9} \le A_{i} \le 10^{9}$
Examples
Input #1
5 3 9 1 7 4
Output #1
8
Input #2
1 -6
Output #2
0