#K93482. Performance Difference

    ID: 38429 Type: Default 1000ms 256MiB

Performance Difference

Performance Difference

You are given a list of completion times for a set of tasks. Your job is to compute the difference between the slowest and the fastest times. Formally, given an array of integers times, you must calculate:

\(\max(times) - \min(times)\)

If the array is empty, the answer is 0.

inputFormat

The first line of input contains a single integer n denoting the number of elements in the list.

If n is greater than 0, the second line contains n space-separated integers representing the completion times. If n is 0, there will be no second line.

outputFormat

Output a single integer, which is the difference between the maximum and the minimum completion time. If the list is empty, output 0.

## sample
5
356 420 300 500 454
200