#include<bits/stdc++.h>
typedef unsigned long long ull;
typedef long long ll;
#define rep(i,l,r) for(int i=l;i<=r;i++)
#define nep(i,r,l) for(int i=r;i>=l;i--)
void sc(int &x){scanf("%d",&x);}
void sc(int &x,int &y){scanf("%d%d",&x,&y);}
void sc(int &x,int &y,int &z){scanf("%d%d%d",&x,&y,&z);}
void sc(ll &x){scanf("%lld",&x);}
void sc(ll &x,ll &y){scanf("%lld%lld",&x,&y);}
void sc(ll &x,ll &y,ll &z){scanf("%lld%lld%lld",&x,&y,&z);}
void sc(char *x){scanf("%s",x);}
void sc(char *x,char *y){scanf("%s%s",x,y);}
void sc(char *x,char *y,char *z){scanf("%s%s%s",x,y,z);}
void out(int x){printf("%d\n",x);}
void out(ll x){printf("%lld\n",x);}
void out(int x,int y){printf("%d %d\n",x,y);}
void out(ll x,ll y){printf("%lld %lld\n",x,y);}
void out(int x,int y,int z){printf("%d %d %d\n",x,y,z);}
void out(ll x,ll y,ll z){printf("%lld %lld %lld\n",x,y,z);}
using namespace std;
const int N=3e5+5;
int n,a[N];
ll sum[N];
int main()
{
    //freopen("1.in","r",stdin);freopen("1.out","w",stdout);
    sc(n);
    rep(i,1,n) sc(a[i]);
    sort(a+1,a+1+n);
    rep(i,1,n) sum[i]=sum[i-1]+a[i];
    ll res=1e18;
    rep(i,1,n)
    {
        ll s=sum[n]-sum[i-1];
        ll cur=1ll*a[i]*n+s*2-1ll*a[i]*(n-i+1)*2;
        res=min(res,cur);
    }
    long double ans=res;
    ans/=2*n;
    printf("%.10f\n",double(ans));
}

#include <bits/stdc++.h>

using namespace std;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	vector<int> a(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	long double lb = 0;
	long double rb = 2e9 + 9;
	long double p = 1.0 / (long double) n;
	auto f = [&](long double x) {
		long double E = 0.0;
		for (int i = 0; i < n; i++) {
			long double v = x + a[i] - min((long double) a[i], 2.0 * x);
			E += p * v;
		}
		return E;
	};
	for (int i = 0; i < 300; i++) {
		long double g = lb + (rb - lb) / 3.0;
		long double h = lb + 2.0 * (rb - lb) / 3.0;
		if (f(g) < f(h)) {
			rb = h;
		} else {
			lb = g;
		}
	}
	cout << setprecision(8) << fixed << f(lb) << '\n';
	return 0;
}
// B
