#include<bits/stdc++.h>
using namespace std;
#define int long long
const int MAXN = 1000010;
int n, k[MAXN], a, b, c, ans;
signed main() {
freopen("Unnamed_Problem.in", "r", stdin);
freopen("Unnamed_Problem.out", "w", stdout);
cin >> n;
for(int i = 1; i <= n; i ++) {
cin >> k[i];
}
sort(k + 1, k + n + 1);
b = k[n];
a = k[1];
c = k[2];
ans = 1e18;
ans = min(ans, c - b * b / (4 * a));
a = k[2];
c = k[1];
ans = min(ans, c - b * b / (4 * a));
cout << ans << endl;
return 0;
}