The
Smallest Pair
You
are given a sequence a1, a2, ..., aN.
Find the smallest possible value of ai + aj, where
1 ≤ i < j ≤ N.
Input
The
first line of each description consists of a single integer N.
The
second line of each description contains N space separated integers - a1,
a2, ..., aN respectively.
Output
A
single line containing a single integer (the smallest possible sum).
Sample Input1:
|
Sample Input2:
|
4
5 1 3 4
|
10
9 2 7 4 5 6 3 8 1 10
|
Sample Output2:
|
Sample Output2:
|
4
|
3
|
Explanation
of Sample1:
Here
we pick a2 and a3. Their sum equals to 1 +
3 = 4.
Для отправки решений необходимо