#include <bits/stdc++.h>
using namespace std;
#define INF 0x3f3f3f3f
#define gcd __gcd
#define FOR(i, a, b) for (int i = a; i <= (b); i++)
#define ROF(i, a, b) for (int i = a; i >= (b); i--)
#define pb(x) push_back(x)
#define ALL(x) x.begin(), x.end()
#define RALL(x) x.rbegin(), x.rend()
#define sz(x) ((int)x.size())
#define fir first
#define sec second
typedef long long ll;
typedef long double ld;
const ll mod =  1e9 + 7;
const double PI = acos(-1.0);
const double eps = 1e-10;
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
const int maxn = 100005;
ll a[maxn];
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    vector<ll> sum(n + 1);
    FOR(i, 1, n) {
        cin >> a[i];
    }
    ll ans = 1e18;
    sort(a + 1, a + 1 + n);
    FOR(i, 1, n) {
        sum[i] = sum[i - 1] + a[i];
    }
    FOR(i, 1, n - 1) {
        ll x;
        if(2 * i - n > 0) {
            x = a[i];
        }
        else x = a[i + 1];

        ans = min(ans, (2 * i - n) * x + 2 * (sum[n] - sum[i]));
    }
    ans = min(ans, n * a[n]);
    ans = min(ans, 2 * sum[n]);
    cout << setprecision(20) << (ld)1.0 * ans / n / 2 << endl;
	return 0;
}
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define mp make_pair


void prepare(){
	
}
void solve(){
	int n;cin>>n;
	int a[n];
	for(int i=0;i<n;i++)cin>>a[i];
	sort(a,a+n);
    int y=a[n/2],ans=0;
    for(int i=0;i<n;i++)ans+=(y+2*a[i]-min(2*y,2*a[i]));
    cout<<setprecision(12)<<(double)ans/(2*n);
	}

signed main(){
	#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    //prepare();
    //cin>>tt;
    //while(tt--)
    solve();
}