A calibration rig reports n sensor gain readings (each an integer, possibly zero or negative). For each position i, consider the product of all readings except the one at i. Output the maximum such leave-one-out product over all positions.
Because there are at least two readings, every leave-one-out product is a product of at least one reading and is well defined.
Input format
Line 1: an integer n.
Line 2: n space-separated integers, the gain readings.
Output format
A single integer: the maximum product obtainable by omitting exactly one reading.
Constraints
- 2 <= n <= 20
- -9 <= each reading <= 9
- The answer is guaranteed to fit in a signed 64-bit integer.