Skip to main content
LIVE CONTEST: Round #7 · Begin Marathon is live now! …

~/algor $ cat problems/minmax/largest-product-of-two-numbers

Largest product of two numbers

Author Iqbolshoh Ilhomjonov 3 @iqbolshoh 650 problems
Medium 1000 ms 128 MB 51%
Share

A positive integer and integers are given. Find the largest value of the product of two elements at different positions ().

Choosing the largest product of two elements

Input

The first line contains a positive integer . The next line contains integers .

Output

One integer.

Note


Examples

Input #1
5
-8 3 -6 5 2
Output #1
48
Input #2
2
-4 7
Output #2
-28

Sign in to submit a solution

Signing up is free and takes a minute.