Marks :100

: 0 | : 0

In a science research lab, combining two nuclear chemicals produces a maximum energy that is the product of the energy of the two chemicals. The energy values of the chemicals can be negative or positive. The scientist wishes to calculate the sum of the energies of the two chemicals which produces maximum energy on reaction.

Write an algorithm to find the sum of energy of the two chemicals which produces maximum energy on reaction.

Input

The first line of the input consists of an integer - numrChem, representing the number of chemicals (N). ($$$0 \le numOfChem \le 10^6$$$)

The second line consists of N space-separated integers- ener*0*, ener*1* ....... ener*N-1* representing the energies of the chemicals.($$$-10^6 \le eneri \le 10^6$$$)

Output

Print an integer representing the sum of energy of the two chemicals which produces maximum energy on reaction

Example

Input

7 9 -3 8 -6 -7 8 10

Output

19

You need to login to view your submissions.

You need to login to view all submissions.

Loading...

Result : Successful

Loading...

Feel something is wrong with the test cases?

Result : Accepted

Test Cases :

But to **Run** or **Submit** the Problem, you need to Log In.

Do let us know your issue.