eolymp
bolt
Try our new interface for solving problems
Problems

Difference between maximum and minimum

Difference between maximum and minimum

Given $n$ integers. Print the difference between the maximum and minimum number. \InputFile The first line contains number $n~(1 \le n \le 100)$. The second line contains $n$ integers, each one is no more than $100$ by absolute value. \OutputFile 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"