Competitions

# PP2: Week 12: June 7 - 13 Java Threads + Functional Interface

# The sum of the largest and the smallest

The array of integers is given. Find the sum of the smallest and the largest element in array.

#### Input

The first line contains the number of elements **n** (**n** ≤ **100**) in array. **n** array elements are given in the second line. Each number in array does not exceed **100** by absolute value.

#### Output

Print the sum of the smallest and the largest element in array.

Input example #1

4 1 2 3 4

Output example #1

5