e-olymp
Competitions

Масиви (початок)

Difference between maximum and minimum

Given n integers. Print the difference between the maximum and minimum number.

Input

First line contains number n (1n100). Second line contains n integers, each no more than 100 by absolute value.

Output

Print the difference between the maximum and minimum number.

Time limit 1 second
Memory limit 128 MiB
Input example #1
7
0 -7 -13 14 -2 13 13
Output example #1
27
Author Matviychuk Sergiy Volodymyrovych
Source "ABC programming"