14921492 SUSTech Online Judge
Problem 1492 --Sum of Products

1492: Sum of Products

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 1237  Solved: 343
[Submit][Status][Web Board]

Description

Given \(n\) integers \(a_1, a_2, …, a_n\) ( \(n\) is even ). It will be divided into \(n\)/2 pairs. Please calculate the minimum sum of these products in every pair.

Input

There will be two lines.

The first line will be an integer \(n\).

The second line will be \(n\) integers \(a_1, a_2, …, a_n\).

For all test cases, \(n\) is even and \(2\leq n\leq10^5, |a_i|\leq10^7\) for all \(1 \leq i \leq n\)

Output

Print the minimum sum of those pair products.

Sample Input

4
1 2 3 4

Sample Output

10

HINT

Source

 

[Submit][Status]