#C5451. Maximum Team Efficiency

    ID: 49102 Type: Default 1000ms 256MiB

Maximum Team Efficiency

Maximum Team Efficiency

You are given an integer (n) representing the number of engineers and a list of (n) positive integers representing the skill levels of these engineers. A team is formed by selecting exactly three engineers. The efficiency of a team is defined as the product of the skill levels of its members. Formally, if the skill levels are (a_1, a_2, \dots, a_n), then the team efficiency for three chosen engineers indexed by (i, j, k) (with (i < j < k)) is given by:

[ E = a_i \times a_j \times a_k ]

Your task is to compute the maximum possible team efficiency. You may assume that (n \geq 3).

inputFormat

The input consists of two lines. The first line contains a single integer (n) (with (3 \leq n \leq 10^5)), which indicates the number of engineers. The second line contains (n) space-separated positive integers representing the skill levels of the engineers.

outputFormat

Output a single integer representing the maximum team efficiency, which is the product of the skill levels of the three selected engineers.## sample

5
1 2 3 4 5
60