#C10165. Maximum Product of Two Distinct Elements

    ID: 39340 Type: Default 1000ms 256MiB

Maximum Product of Two Distinct Elements

Maximum Product of Two Distinct Elements

You are given an array of integers of size \( n \). Your task is to compute the maximum product of any two distinct elements in the array.

Input: The first line contains an integer \( n \), the number of elements. The second line contains \( n \) space-separated integers.

Output: Print a single integer denoting the maximum product obtainable from any two distinct elements in the array.

It is guaranteed that \( n \geq 2 \).

inputFormat

The input consists of two lines. The first line contains a single integer ( n ) representing the number of elements. The second line contains ( n ) space-separated integers.

outputFormat

Output a single integer, the maximum product of any two distinct elements from the given list.## sample

6
1 10 2 6 5 3
60