#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef long double ld;
/*
#include <chrono> 
using namespace std::chrono;
#include <boost/multiprecision/cpp_int.hpp> 
using namespace boost::multiprecision;
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
#define ordered_set tree<lli, null_type,less_equal<lli>, rb_tree_tag,tree_order_statistics_node_update> 
//remove _equal from less_equal to make it ordered set , currently it is ordered_multiset
*/
#define pb push_back
const lli mod=1e9+7;
const lli mod1=998244353;
#define fir first
#define sec second
#define plli pair<lli,lli>
#define pplli pair<lli,plli>
/*
lli power(lli a, lli b) {
    lli res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}
lli powermod(lli a, lli b) 
{
    lli res = 1;
    while (b > 0) {
        if (b & 1)
            res = ((res%mod)*(a%mod))%mod;
        a = (a * a)%mod;
        b >>= 1;
    }
    return res%mod;
}
*/
int main()
{
    lli T,i,j;
    T=1;
    while(T--)
    {
        
        lli n;
        cin>>n;
        lli a[n];
        for(i=0;i<n;i++)
            cin>>a[i];
        sort(a,a+n);
        lli x=a[n/2]/2;
        lli f=(a[n/2]%2);
        lli loss=0;
        for(i=0;i<n;i++)
        {
            lli z=((a[i]+x)-min(a[n/2]*1ll,a[i]*1ll));
            loss=loss+z;
        }
        if(f)
        {
            loss+=(n/2);
        }
        ld ans=(ld) loss/n;
        if((n%2==1)and(f))
            ans=ans+ ((ld)0.5/n);
        cout<<fixed<<setprecision(10)<<ans<<"\n";
    }
    return 0;
}
















#include <bits/stdc++.h>
using namespace std;

int main(){
    int N;
    cin >> N;
    vector<int> T(N);
    int sum = 0;
    for(int i = 0; i < N; i++){
        cin >> T[i];
        sum += T[i];
    }
    int ave = (sum+1)/2;
    vector<vector<int>> dp(101, vector<int>(1000001, 0));
    for(int i = 0; i < N; i++){
        for(int t = 0; t <= ave; t++){
            if(t >= T[i] && abs(ave-dp[i][t-T[i]] - T[i]) < abs(ave-dp[i][t])){
                dp[i+1][t] = dp[i][t-T[i]] + T[i];
            }else{
                dp[i+1][t] = dp[i][t];
            }
            dp[i+1][t];
        }
    }
    cout << max(dp[N][ave], sum-dp[N][ave]) << endl;
}
