HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Problems from Olympiads.ru > problem:


127b. 50730 - The largest product

Guest
• Review clarifications (1)

Volume problems

• 102. 50237 - Is it the same color?
• 103. 50238 - The smallest number
• 105. 50243 - Sum of digits
• 107a. 50240 - The numbers that are...
• 107b. 50242 - Numbers whose sum...
• 113. 50241 - Greatest common divisor
• 127b. 50730 - The largest product
• 127c. 50731 - The largest product (2)
• 138. 50732 - Sorting
• 147. 50251 - Symmetric matrix
• 213. 50769 - Arithmetic expression
• 217. 50253 - Timer
• 133. 50239 - Eating cheese
• 159. 50668 - Triangle
• 206. 50252 - Birthday

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.

Given N integers. You are asked to choose two of them such that whose product is maximum.

Input
Firstly, N - the number of numbers in sequence (2 <= N <= 100). Further, the sequence is written: N of integers which are less than 1000.
Output
Bring out the two unknown numbers in any order. If there are several different pairs of numbers that give the maximum product, then bring out any of them.

input 1 Input 2
9
3 5 1 7 9 0 9 -3 10
3
-5 -300 -12
Output 1 Output 2
9 10
-300 -12

Для отправки решений необходимо выполнить вход.

www.contester.ru