The sum of the largest and the smallest
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
The array of integers is given. Find the sum of the smallest and the largest elements of the array.
Input
The first line contains the number of elements in the array. The second line contains elements of the array. Each number in the array does not exceed in absolute value.
Output
Print the sum of the smallest and the largest elements of the array.
Examples
Input #1
Answer #1
Submissions 45K
Acceptance rate 55%