85. Maximum Product of Two
EasyArray
Print the maximum product of two elements at different positions.
Input format
Line 1: n Line 2: n integers
Output format
The maximum product.
Example 1
Input
5 1 4 3 6 7
Output
42
Example 2
Input
4 -10 -3 5 6
Output
30
Constraints
2 ≤ n ≤ 10⁵ |values| ≤ 10⁵
Read input from standard input and print the answer to standard output. Your code is judged against 6 test cases, most of them hidden.
Loading the MyLoginn IDE…