The sum of the largest and smallest
One-dimensional array A of integers is given. Find the sum of the least and the biggest element in array.
Specifications
Input
In the first line the number of elements h in array is given (h ≤ 100). In the second line the elements of array are given. Each number in array by absolute value does not exceed 100.
Output
In one line print one number - the answer to the problem.
Problem information
Time Limit: 0.5 secondsMemory Limit: 64 MB
Balls for the passed test: 1.66667
Complexity: 8% 835/906
Source: SFE-2010 Variant 28
Classes: Beginners
Example
Example input4 1 2 3 4 |
Example output5 |
| ← Number of toys | Problems | Parallelogram → |
