// author :: enigma74

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

#define ll long long
#define ld long double
#define vec(v) v.begin(),v.end()
#define MOD (1e9+7)

void FASTIO(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
}

void solve_logic(){
	ll n;
	cin>>n;
	ld arr[n],sum=0,ans=0;
	for(ll i=0;i<n;i++){
		cin>>arr[i];
		sum+=arr[i];
	}
	ans+=sum;
	sort(arr,arr+n);
	ld x=0;
	if(n%2!=0){
		x=arr[((n+1)/2)-1]/2;
	}else{
		x=(arr[n/2-1]+arr[(n/2)])/4;
	}
	ans+=n*x;
	ld temp=0;
	for(ll i=0;i<n;i++){
		temp+=min(arr[i],2*x);
	}
	ans-=temp;
	ans/=n;
	cout.precision(20);
	cout<<fixed<<ans;

}

int main(){
    // #ifndef ONLINE_JUDGE
    //     freopen("input.txt","r",stdin);
    //     freopen("output.txt","w",stdout);
    // #endif
    FASTIO();
    // ll T;
    // cin>>T;
    // while(T--){
        // solve_logic();
    // }

    solve_logic();
    return 0;
}
#pragma GCC optimize("Ofast")
 #include <bits/stdc++.h>
#define ll         long long int
#define umap       unordered_map
#define mod        1000000007ll
#define pb         push_back
#define all(x)     (x).begin(), (x).end()
#define rall(x)    (x).rbegin(), (x).rend()
#define MN(a,b,c)  min(a,min(b,c))
#define MX(a,b,c)  max(a,max(b,c))
#define pr1         pair<ll,ll>
#define F          first
#define S          second
#define mP         make_pair
#define f(i,n)     for(ll i=0;i<n;i++)
#define f1(i,x,y)  for(ll i=x;i<=y;i++)
#define f2(i,x,y)  for(ll i=x;i>=y;i--)
#define yes        cout<<"YES"<<"\n"
#define no         cout<<"NO"<<"\n"
#define modsum(a,b)  ((a%mod)+(b%mod))%mod
#define modpro(a,b)  ((a%mod)*(b%mod))%mod
#define moddif(a,b)  ((a%mod)-(b%mod)+mod)%mod
#define modsumt(a,b,c) modsum(a,modsum(b,c))
//__builtin_popcount(x)
//__builtin_parity(x)   =(number of set bits)%2
//__builtin_clz(x)      to count the number of leading  zeroes 
//__builtin_ctz(x)      to count the number of trailing zeroes 
//__gcd(a,b)
// Binary Search 
// TO AVOID GETTING INFINITE LOOP
// mid = (l+r)/2      l=mid+1   r=mid
// mid = (l+r+1)/2    l=mid     r=mid-1
using namespace std;
ll fac[200005];
/*void calc_pow2()
{
    pow2[0]=1;
    for(ll i=1;i<63;i++) pow2[i]=2*pow2[i-1];
}*/
ll modularExponentiation(ll x,ll n,ll M)
{
    ll result=1;
    while(n>0)
    {
        if(n % 2 ==1)
            result=modpro(result,x);
        x=modpro(x,x);
        n=n/2;
    }
    return result;
}
ll binaryExponentiation(ll x,ll n)
{
    ll result=1;
    while(n>0)
    {
        if(n % 2 ==1)
            result=result * x;
        x=x*x;
        n=n/2;
    }
    return result;
}
ll pow1(ll x,ll y)
{
    ll z=1;
    while(y--){z=z*x;}
    return z;
}
/*bool isprime(ll n)
{
    // Corner cases
    if (n <= 1)
        return false;
    if (n <= 3)
        return true;
 
    // This is checked so that we can skip
    // middle five numbers in below loop
    if (n % 2 == 0 || n % 3 == 0)
        return false;
 
    for (int i = 5; i * i <= n; i = i + 6)
        if (n % i == 0 || n % (i + 2) == 0)
            return false;
 
    return true;
}*/
// Returns n^(-1) mod p 
ll  modInverse(ll n, ll p) 
{ 
    return modularExponentiation(n, p - 2, p); 
} 
// Returns nCr % p using Fermat's little 
// theorem. 
unsigned long long nCrModPFermat(unsigned long long n, 
                                 ll r, ll p) 
{ 
    // Base case 
    if (r == 0) 
        return 1; 
  
    // Fill factorial array so that we 
    // can find all factorial of r, n 
    // and n-r 
    return (fac[n] * modInverse(fac[r], p) % p * modInverse(fac[n - r], p) % p) % p; 
}
ll check(ll x,ll y)
{
    ll z=1;
    ll ans=0;
    while(z<x){ans++;z*=y;}
    return ans;
}

ll countbits(ll n)
{
    ll x=0;
    while(n>0)
    {
        x++;
        n=(n&(n-1));
    }
    return x;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n;cin>>n;
    vector <ll> a(n);
    ll sum=0;
    f(i,n) {cin>>a[i];sum+=a[i];}
    sort(all(a));
    double ans;
    if(n%2)
    {
        double x = (a[n/2]*1.0)/2;
        double s=0;
        f(i,n) s+=min((double)a[i],2*x);
        ans=sum+(n*x)-s;
    }
    else
    {
        double x1 = (a[n/2]*1.0)/2;
        double x2=  (a[(n+1)/2]*1.0)/2;
        double s1=0,s2=0;
        f(i,n) {s1+=min((double)a[i],2*x1);s2+=min((double)a[i],2*x2);}
        ans=sum+min(n*x1-s1,n*x2-s2);
    }
      ans=ans/(1.0*n);
      std::cout << std::fixed; std::cout << std::setprecision(10); std::cout << ans;

}