PRODUCT
Medium
Execution time limit is 0.3 seconds
Runtime memory usage limit is 128 megabytes
We have N integers. What is the maximum product that can be achieved by using exactly three of these numbers?
Input
The first line contains a non-negative integer N (3≤N≤10^6)
. The second line lists N integers, each with an absolute value no greater than 10^5
.
Output
Output the maximum product obtainable from any three of these integers.
Examples
Input #1
Answer #1
Submissions 3K
Acceptance rate 11%