#P1011. The Enigmatic Integer List

The Enigmatic Integer List

Problem Description

In a distant, mystical land known as Numeria, there lies a peculiar village called Arithmetica. The villagers of Arithmetica are avid mathematicians, and they love playing mathematical games. In the heart of this village, there stands an ancient and enigmatic Tree of Numbers.

The Tree of Numbers is rumored to possess magical properties, granting great power to those who can decipher its secrets. Legend has it that if you present the Tree with a list of (n) integers, it will reveal the maximum possible product of two numbers from the list.

Now, you've been entrusted with a quest: help the villagers of Arithmetica by writing a program to unveil the Tree's mysteries and find the maximum product of two numbers from a given list.

Input Format

The first line contains an integer, nn (2≤n≤50002 \leq n \leq 5000), representing the number of integers in the list. The second line contains nn integers a1,a2,…,ana_1, a_2, \ldots, a_n (−5×105≤ai≤5×105-5 \times 10^5 \leq a_i \leq 5 \times 10^5), separated by spaces. These integers represent the offerings to the Tree of Numbers.

Output Format

Output a single number, the maximum product of two numbers that can be obtained from the given list.

Sample

样例输入

6
1 2 3 4 5 6

样例输出

30

Hint

For all test cases, 2≤n≤50002 \leq n \leq 5000, and −5×105≤ai≤5×105-5 \times 10^5 \leq a_i \leq 5 \times 10^5.