Greatest work
Problem
Given N
integers. It is required to choose from them three such numbers, the product of which is maximal.
Input:
The input is first the number N
- the number of numbers in the sequence (\(3<=N<=100\)).
Next comes the sequence itself: N
integers, modulo not exceeding 1000.
Output:
Print the three desired numbers in any order.
If there are several distinct triples of numbers that give the maximum product, then print any of them.
Examples
# |
Input |
Output |
1 |
9
3 5 1 7 9 0 9 -3 10
|
9 10 9 |
2 |
3
-5 -300 -12
|
-5 -300 -12 |