#C1837. Minimum Height Difference

    ID: 45086 Type: Default 1000ms 256MiB

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:

  1. The first line contains an integer N, the number of stacks.
  2. 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)$.

## sample
1
5
0