#C1837. Minimum Height Difference
Minimum Height Difference
Minimum Height Difference
Given N stacks of boxes with varying heights, your task is to compute the minimum possible height difference between the highest and the lowest stack. In mathematical terms, you need to determine:
$\max_{1 \leq i \leq N}(h_i) - \min_{1 \leq i \leq N}(h_i)$
The order of the stacks does not affect the calculation. Essentially, you are to take into account all stacks and simply output the difference between the maximum and minimum heights.
inputFormat
The input is read from stdin and has the following format:
- The first line contains an integer N, the number of stacks.
- The second line contains N space-separated integers representing the heights of the stacks.
outputFormat
Output to stdout a single integer which is the minimum possible height difference between the stacks, i.e. $\max(h_i)-\min(h_i)$.
## sample1
5
0