407213: GYM102697 184 Close Product
Description
You have $$$n$$$ positive integers, and you want to find their product. However, you have to omit exactly one of the integers from the list before calculating the product. You want to find the maximum product of the list, after omitting exactly one integer from the list.
For example, given the numbers $$$2$$$, $$$4$$$, and $$$5$$$, the maximum product is $$$5$$$ * $$$4$$$ = $$$20$$$. $$$2$$$ * $$$4$$$ * $$$5$$$ is not valid, because none of the numbers were omitted.
InputThe first line of input contains a single positive integer $$$n$$$: the number of integers in the list.
The next $$$n$$$ lines each contain a single positive integer: each element of the list.
OutputOutput a single positive integer $$$p$$$: the maximum possible product of all integers in the list, if you omit exactly one. The answer is guaranteed to fit inside of a 32-bit integer type.
ExamplesInput5 3 5 6 8 10Output
2400Input
4 4 3 2 1Output
24Input
5 3 3 3 3 3Output
81