**Problem link** : contest practice

**Difficulty** : CakeWalk

**Pre-requisites** : Sorting

**Problem** : Given a sequence **a _{1}, a_{2}, …, a_{N}**. Find the smallest possible value of

**a**, where 1 ≤

_{i}+ a_{j}**i**<

**j**≤

**N**

##Explanation

This problem was the easiest one in the set and it was intended to enable everybody to get some points.

### How to get 13 points

Here you have only two integers **a _{1}** and

**a**, so the only possible sum will be

_{2}**a**.

_{1}+a_{2}### How to get 60 points

The constraints were designed in such a way that you can iterate through all the possible pairs (**i**, **j**), where 1 ≤ **i** < **j** ≤ **N** and check for every obtained sum, whether it’s the minimal one.

### How to get 100 points

The answer is basically the sum of the minimal and the second-minimal element in the array. So you can simply iterate through all the numbers, keeping track of the minimal and the second-minimal number. Or if your programming language has built-in sorting, you can act even simpler, because after the sorting of the array in increasing order, the required minimal and the second-minimal will be the first and the second elements of the sorted array.

### Related links

- Reference in the built-in sorting for C++ users