Solved by 900 users: ...
UserDateAttemptTimeCMSC
V.A.KeRneL`12 feb 2007`Ruby1100.0253
V.A.KeRneL`12 feb 2007`Ruby1000.0258
V.A.KeRneL`10 feb 2007`Ruby800.0270
V.A.KeRneL`10 feb 2007`Ruby900.0270
sb3ar`18 apr 2007`Ruby400.0370
sb3ar`17 apr 2007`Ruby300.0374
V.A.KeRneL`06 feb 2007`Ruby400.0278
extremeplay`10 nov 2014`Ruby500.0285
sb3ar`17 apr 2007`Ruby200.0390
Nakilon`20 feb 2010`Ruby300.0294
sb3ar`11 jan 2008`Ruby800.0296
kronos`13 dec 2010`Ruby1100.0298
StarWorm`08 jun 2009`Python400.0998
vi002`28 apr 2007`Ruby1300.02101
kronos`13 dec 2010`Ruby1000.02102
sb3ar`23 dec 2007`Ruby600.02105
kronos`13 sep 2009`Ruby900.02105
kronos`01 jul 2007`Ruby800.02108
bush`29 mar 2006`Ruby300.02110
DAV`25 jun 2009`C++500.02110
e2n`28 sep 2008`Python200.07110
kronos`26 apr 2007`Ruby500.02111
DAV`04 jun 2009`C++200.02120
 C++ 417 FPC 241 C 135 Java 56 Kylix 45 Ruby 13 Python 5 Perl 3 Lua 1 Scheme 1
` >  >  >  >  >  >  >  >  >  > `

## 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 DevGroupThe page was generated in 200ms