#C12196. Maximum Product of Two Integers

    ID: 41596 Type: Default 1000ms 256MiB

Maximum Product of Two Integers

Maximum Product of Two Integers

You are given an array of n integers (with n ≥ 2). Your task is to find two distinct integers in the array such that their product is maximum.

Mathematically, if the array is given by nums, you need to compute:

$$\max_{0 \le i < j < n}(nums[i] \times nums[j])$$

If the array contains fewer than two integers, the program should report an error. However, you can assume that the input will always have at least two numbers.

Input is read from stdin and output should be written to stdout.

inputFormat

The first line contains a single integer n (n ≥ 2), representing the number of integers in the array.

The second line contains n space-separated integers.

outputFormat

Output a single integer, which is the maximum product obtained by multiplying any two distinct integers from the given array.

## sample
4
1 2 3 4
12

</p>