A Max Problem

View as PDF

Submit solution

Points: 3
Time limit: 1.0s
Memory limit: 64M

Problem type

Max loves to maximize elements. As such, he gives you an array \(a\) of length \(N\), and wants you to print the maximum product of any \(2\) elements in the array! Note that the two elements could both be the same element.

Input Specification

The first line will contain the integer \(N\ (1 \le N \le 100)\).

The next line will contain \(N\) integers, \(a_1, a_2, \ldots, a_N\ (|a_i| \le 10^9)\).

Output Specification

Output the maximum product of any two elements.

Sample Input

1 3 2

Sample Output



There are no comments at the moment.