Processing math: 100%

Time Limit : sec, Memory Limit : KB
English / Japanese  

Maximizing Rational Expression

We are given N different natural numbers. When we pick four diffrent ones from them and let them be A, B, C, D , we want to find the maximum value of the following expression:

A+BCD


Your program must find the maximum value of the maximum value of the expression above when N diffrent natural numbers are given.

Input

Input is given in following format.

N
a1 a2 ... aN

First line is the number of given natural numbers: N (4 ≤ N ≤ 1000). Second line provides the value of each natural numbers: ai (1 ≤ ai ≤ 108) . Same natural numbers are NOT given in one case. (when ij, aiaj)。

Output

According to N natural numbers given, output the maximum value of the expression above in real number. The acceptable error range is +/- 10-5 .

Sample Input 1

10
1 2 3 4 5 6 7 8 9 10

Sample Output 1

19.00000

In this case, letting A=9, B=10, C=2, D=1 miximizes the value.


Sample Input 2

5
22 100 42 3 86

Sample Output 2

9.78947

In this case, letting A=100, B=86, C=22, D=3 miximizes the value.


Sample Input 3

6
15 21 36 10 34 5

Sample Output 3

18.00000

In this case, letting A=21, B=15, C=36, D=34 maximizes the value.


Sample Input 4

4
100000 99999 8 1

Sample Output 4

28571.285714


 
BESsBESsBESsBESsBESsBESsBESsBESs