DMOPC '19 Contest 1 P0 - Range Finding

View as PDF

Submit solution


Points: 3
Time limit: 3.0s
C# 1.4s
Java 1.4s
Python 1.4s
Memory limit: 64M
C# 128M
Java 128M
Python 128M

Author:
Problem type

You are given N numbers, a1,a2,,aN. Output the range of this list. The range of a list of numbers is the difference between the largest and smallest values in this list.

Constraints

In all tests,
1N1000000
109ai109

Input Specification

The first line contains one number, N.
The second line contains N spaced integers, ai, the numbers in this list.

Output Specification

On one line, output the range of the N numbers.

Sample Input

Copy
10
9 2 9 6 8 7 1 3 9 6

Sample Output

Copy
8

Comments

There are no comments at the moment.