#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N=1e5+100;
int n,a[N];
int sum[N];
signed main(){
    ios::sync_with_stdio(false),cin.tie(0);
    cin>>n;
    for(int i=1;i<=n;i++) cin>>a[i];
    sort(a+1,a+1+n);
    for(int i=1;i<=n;i++){
        sum[i]=sum[i-1]+a[i];
    }
    double ans=1e18;
    for(int i=1;i<=n;i++){
        double x=1.0*a[i]/2;
        ans=min(ans,x*i+(sum[n]-sum[i])-(n-i)*x);
    }
    cout<<fixed<<setprecision(20)<<ans/n<<endl;
}
#include <bits/stdc++.h>
//#include <atcoder/all>
using namespace std;
//using namespace atcoder;
using ll=long long;
using ld=long double;
using pll=pair<ll, ll>;
//using mint = modint1000000007;
#define rep(i,n) for (ll i=0; i<n; ++i)
#define all(c) begin(c),end(c)
#define PI acos(-1)
#define oo 2e12
template<typename T1, typename T2>
bool chmax(T1 &a,T2 b){if(a<b){a=b;return true;}else return false;}
template<typename T1, typename T2>
bool chmin(T1 &a,T2 b){if(a>b){a=b;return true;}else return false;}
//priority_queue<ll, vector<ll>, greater<ll>> Q;
// LMAX = 18446744073709551615 (1.8*10^19)
// IMAX = 2147483647 (2.1*10^9)
/*

*/
int main(){
  cin.tie(0);
  ios::sync_with_stdio(0);
  cout << fixed << setprecision(10);
  ll N;
  cin >> N;
  ll A[100010];
  rep(i, N) cin >> A[i];
  ld high = oo;
  ld low = 0.0;
  ld mh = (high*2.0 + low)/3.0;
  ld ml = (high + low * 2.0)/3.0;
  ld ans = oo;
  while (high > low + 0.00001){
    ld lost1 = 0.0;
    ld lost2 = 0.0;
    rep(i, N){
      lost1 += mh + A[i] - min(2.0*mh, ld(A[i]));
      lost2 += ml + A[i] - min(2.0*ml, ld(A[i]));
    }
    if (lost1 > lost2) high = mh;
    else low = ml;
    mh = (high*2.0 + low)/3.0;
    ml = (high + low * 2.0)/3.0;
    chmin(ans, lost1/N);
    chmin(ans, lost2/N);
  }
  ans += 0.000000001;
  cout << ans << endl;
}
