Олимпиадный тренинг

Задача 29641. Quiet Don №1


Задача

Темы: Битовые операции
In peacetime, the Cossacks are engaged in agriculture. Pantelei Prokofievich Melekhov grows special mathematical vegetables that grow according to very strange rules: each seed i of these vegetables has a yield value ai, and the yield of the entire garden bed is the product of the yields of all the seeds planted on it. Melekhov has N seeds. Help him choose a few of these seeds so that when planting these seeds, the yield of the garden bed is maximum.
 
Input:
The first line contains the number N (1 <= N <= 15)
Second - N numbers ai, possibly real (|ai| < 10)
 
Output:
Output the maximum yield of the bed, to at least 6 decimal places, that can be achieved with the given set of seeds. It is guaranteed that it is greater than 1.
 
Input Output
5
2.0 -1.2 4.7 -2.9 -1.1
32.712000

(с) Grigoriev E., 2018