1797: 【CSP数组】求n个数的最大值和最小值▅

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:5 Solved:5

Description

任意输入 lns="http://www.w3.org/1998/Math/MathML">n 个整数,把它们的最大值,最小值求出来。

Input

输入只有一行,包括一个整数 lns="http://www.w3.org/1998/Math/MathML">n (lns="http://www.w3.org/1998/Math/MathML">1n20),后面跟着 lns="http://www.w3.org/1998/Math/MathML">n 个数, 每个数的范围在lns="http://www.w3.org/1998/Math/MathML">032767之间。

Output

输出只有一行,包括 lns="http://www.w3.org/1998/Math/MathML">2 个整数。最大值在前,最小值在后。

Sample Input Copy

5 1 99 3 6 0

Sample Output Copy

99 0