Problem: N different natural numbers are given. If you select four different ones and set them as $ A $, $ B $, $ C $, $ D $, the following formula

$ \ Frac {A + B} {C --D} $



I want to find the maximum value of.




Given N different natural numbers, choose 4 different from them and create a program to find the maximum value of the above formula.



Input

The input is given in the following format.


N
a1 a2 ... aN


The number N (4 ≤ N ≤ 1000) of natural numbers is given in the first line. The value ai (1 ≤ ai ≤ 108) of each natural number is given in the second line. However, the same natural number does not appear more than once (ai ≠ aj for i ≠ j).

Output

Outputs the maximum value of the above formula as a real number for a given N natural numbers. However, the error must not exceed plus or minus 10-5.

Examples

Input

10
1 2 3 4 5 6 7 8 9 10


Output

19.00000


Input

5
22 100 42 3 86


Output

9.78947


Input

6
15 21 36 10 34 5


Output

18.00000


Input

4
100000 99999 8 1


Output

28571.285714

Solution (in CPP):

Solution:
#include <iostream>
#include <vector>
using namespace std;

void merge(vector<int> &n, int left, int mid, int right)
{
	int num = right - left;
	int *tmp = new int[num];

	int iw = 0;
	int il = left;
	int ir = mid;

	while (il < mid && ir < right)
	{
		if (n[il] <= n[ir])
		{
			tmp[iw++] = n[il++];
		}
		else {
			tmp[iw++] = n[ir++];
		}
	}

	while (il < mid) tmp[iw++] = n[il++];
	while (ir < right) tmp[iw++] = n[ir++];

	for (int i = 0; i<num; i++) n[left + i] = tmp[i];

	delete[] tmp;
}


void merge_sort_sub(vector<int> &n, int left, int right)
{
	if (right - left <= 1) return;

	int mid = left + (right - left) / 2;
	merge_sort_sub(n, left, mid);
	merge_sort_sub(n, mid, right);

	merge(n, left, mid, right);
}


void merge_sort(vector<int> &n, int len)
{
	merge_sort_sub(n, 0, len);
}


int main()
{
	int N; 
	cin >> N;
	vector<int> a(N);

	for (int i = 0; i < N; i++) {
		cin >> a[i];
	}

	merge_sort(a, N);

	double A[2] = { 0.0,0.0 };
	double B[2] = { 0.0,0.0 };
	double C[2] = { 0.0,0.0 };
	double D[2] = { 0.0,0.0 };
	int min = 1000000;
	int used[2] = { 0,0 };
	
	A[0] = a[N - 1];
	B[0] = a[N - 2];

	for (int i = 0; i < N - 3; i++) {
		if ((a[i+1] - a[i]) < min) {
			C[0] = (double)a[i+1];
			D[0] = (double)a[i];
			min = a[i+1] - a[i];
		}
	}
	
	min = 1000000;
	for (int i = 0; i < N - 1; i++) {
		if ((a[i+1] - a[i]) < min) {
			C[1] = (double)a[i+1];
			D[1] = (double)a[i];
			min = a[i+1] - a[i];
			used[0] = i+1;
			used[1] = i;
		}
	}
	a.erase(a.begin() + used[0]);
	a.erase(a.begin() + used[1]);

	A[1] = (double)a[N - 4];
	B[1] = (double)a[N - 3];

	double data1 = (double)((A[0] + B[0]) / (C[0] - D[0]));
	double data2 = (double)((A[1] + B[1]) / (C[1] - D[1]));

	std::cout.setf(std::ios_base::fixed, std::ios_base::floatfield);
	if (data1 < data2)
		cout << data2 << endl;
	else
		cout << data1 << endl;
	return 0;
}