#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;
#define int long long
using vec_int = vector<int>;
// using T = tuple<int,int,int>;
using P = pair<int,int>;
using ll = long long;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)

int charToInt(char c){
    char zero_num = '0';
    return (int)c - (int)zero_num;
}
void cout_line(vector<int> &a){
    for(int i=0;i<a.size();i++){
        if(i<a.size()-1){
            cout<<a.at(i)<<" ";
        }else{
            cout<<a.at(i)<<endl;
        }
    }
}

long double calc(vector<long double> &A, long double mid){
    double result = 0.;

    for(int i=0;i<A.size();i++){
        result += mid+A.at(i)-min(A.at(i), 2.*mid);
    }
    return result/((long double)A.size());
}

signed main(){
    int N; cin>>N;
    vector<long double> A(N); rep(i,N)cin>>A.at(i);

    long double left = 0.;
    long double right = 2*(int)pow(10,9);

    while(right>left+pow(10,-7)){
        long double mid1 = (left*2. + right)/3.;
        long double mid2 = (left + right*2.)/3.;
        if(calc(A, mid1)>calc(A,mid2)){
            left = mid1;
        }else{
            right = mid2;
        }
    }
    cout<<fixed<<setprecision(10)<<calc(A,left)<<endl;



    return 0;

}