#T587. 最大跨度值

最大跨度值

Description

Given a sequence of non-negative integers of length n, compute the maximum span value of the sequence (maximum span value = maximum value minus minimum value).

Input Format

There are two lines of input. The first line contains the number of elements in the sequence, n (1 ≤ n ≤ 1000). The second line contains the n non-negative integers of the sequence, each no greater than 1000, separated by single spaces.

Output Format

Output a single line representing the maximum span value of the sequence.

6
3 0 8 7 5 9
9

翻译结果

CodesOnline

(注:由于"CodesOnline"是一个专有名词或品牌名称,通常保持原样不翻译。如果上下文有特殊要求需要意译,可考虑译为"在线代码"或"代码在线",但在此保持原版更为合适。)