#K47097. Maximum Product of Two
Maximum Product of Two
Maximum Product of Two
Given a list of integers, find the maximum product obtainable by multiplying two distinct elements. Formally, given an array \(A\) of length \(n\) (with \(n \ge 2\)), compute \(\max_{1 \leq i < j \leq n} (A_i \times A_j)\). Note that the array may include negative numbers, so the product of two negative numbers can be positive and may yield the maximum product.
inputFormat
The input is read from standard input (stdin) and has the following format:
- The first line contains a single integer \(n\) (where \(n \ge 2\)), representing the number of elements in the list.
- The second line contains \(n\) space-separated integers representing the elements of the list.
outputFormat
Output a single integer representing the maximum product that can be obtained by multiplying any two distinct elements from the input list. The output should be printed to standard output (stdout).
## sample5
1 2 3 4 5
20