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:
Your program must find the maximum value of the maximum value of the expression above when N diffrent natural numbers are given.
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 i ≠ j, ai ≠ aj)。
According to N natural numbers given, output the maximum value of the expression above in real number. The acceptable error range is +/- 10-5 .
10 1 2 3 4 5 6 7 8 9 10
19.00000
In this case, letting A=9, B=10, C=2, D=1 miximizes the value.
5 22 100 42 3 86
9.78947
In this case, letting A=100, B=86, C=22, D=3 miximizes the value.
6 15 21 36 10 34 5
18.00000
In this case, letting A=21, B=15, C=36, D=34 maximizes the value.
4 100000 99999 8 1
28571.285714