#K63982. Maximum Product of Two Numbers
Maximum Product of Two Numbers
Maximum Product of Two Numbers
You are given an array of N integers. Your task is to find the maximum product that can be obtained by multiplying any two distinct elements in the array.
Note: The input may contain both positive and negative numbers. Remember that the product of two negative numbers can be positive.
The formula to calculate the product of two numbers, a and b, is given by:
\( a \times b \)
It is guaranteed that the array will have at least two elements.
inputFormat
The input consists of two lines:
- The first line contains an integer N, representing the number of elements in the array.
- The second line contains N space-separated integers, representing the elements of the array.
outputFormat
Output a single integer which is the maximum product of any two distinct elements in the array.
## sample5
1 4 3 6 7
42
</p>