<PREV Problem:
NEXT>
Solved by 900 users: ...
 < 
 < 
 < 
 < 
 < 
 < 
 < 
 < 
 < 
 < 

Max product

Time limit = 5 seconds

You are given N integer numbers. Choose thee of them which give maximum product.

Input. The first line contains N (3 ≤ N ≤ 106). Then N integer numbers follow. Absolute value of each number less than 30000.

Output Output the numbers in any order. If there are several soulutions output one of them.

Input#1
9
3 5 1 7 9 0 9 -3 10
Output#1
9 10 9

Input#2
3
-5 -30000 -12
Output#2
 -5 -30000 -12

Author:
Moscow school contest, 2004

<PREV | Problem set | Search related messages | NEXT>


© acm.mipt DevGroup
The page was generated in 190ms

SW soft NIX
ID = 54.224.18.114