Problem2128--最大值和最小值的差

2128: 最大值和最小值的差

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 14  Solved: 8
[Status] [Submit] [Creator:]

Description

给定一个整数序列,输出这个序列中最大的数和最小的数的差。

Input

第一行,一个整数M,表示整数序列中整数的个数,1≤M≤10000
第二行,用空格隔开的M个整数,每个整数的绝对值不大于10000

Output

输出M个数中,最大值和最小值的差

Sample Input Copy

5
2 5 7 4 2

Sample Output Copy

5

Source/Category