#K75302. Product of Minimum and Maximum

    ID: 34389 Type: Default 1000ms 256MiB

Product of Minimum and Maximum

Product of Minimum and Maximum

Given a list of integers, you are required to compute the product of its minimum and maximum elements. Formally, if \(m = \min\{a_1, a_2, \dots, a_n\}\) and \(M = \max\{a_1, a_2, \dots, a_n\}\), then the result is \(m \times M\). Note that the list must contain at least two integers.

inputFormat

The input begins with an integer \( n \) representing the number of elements in the list. This is followed by \( n \) space-separated integers.

outputFormat

Output a single integer: the product of the minimum and maximum integers in the list.

## sample
5
2 5 1 8 7
8

</p>