#include<cstdio>
#include<iomanip>
using namespace std;
int n;
long long x,max1;
long long min2=1e9,min1=1e9;
int main()
{
freopen("Unnamed_Problem.in","r",stdin);
freopen("Unnamed_Problem.out","w",stdout);
scanf("%d",&n);
while(n--)
{
scanf("%lld",&x);
if(x>max1) max1=x;
if(x<min1) min2=min1,min1=x;
else if(x<min2) min2=x;
}
printf("%lld\n",min(min1-max1*max1/min2/4,min2-max1*max1/min1/4));
return 0;
}