/*
 * @Author: tusikalanse
 * @Date: 2021-06-12 20:33:13
 * @LastEditTime: 2021-06-12 20:37:22
 * @LastEditors: tusikalanse
 * @Description: 
 * @FilePath: /undefined/mnt/e/algo/atcoder/arc/122/b.cpp
 */
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
LL gcd(LL a, LL b) {
    return b == 0 ? a : gcd(b, a % b);
}

const int N = 1e5 + 10;

int n, a[N];

double check(double x) {
    double ans = 0;
    for (int i = 1; i <= n; ++i)
        ans += x + a[i] - min(0.0 + a[i], 2 * x);
    return ans / n;
}

int main() {
    cin >> n;
    for (int i = 1; i <= n; ++i)
        cin >> a[i];
    double l = 0, r = 1e9;
    while (r - l > 1e-6) {
        double ll = l + (r - l) / 3;
        double rr = r - (r - l) / 3;
        if (check(ll) > check(rr)) 
            l = ll;
        else
            r = rr;
    }
    printf("%.15f\n", check(l));
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
void debug_out() { cerr << endl; }
template<class T> ostream& prnt(ostream& out, T v) { out << v.size() << '\n'; for(auto e : v) out << e << ' '; return out;}
template<class T> ostream& operator<<(ostream& out, vector <T> v) { return prnt(out, v); }
template<class T> ostream& operator<<(ostream& out, set <T> v) { return prnt(out, v); }
template<class T1, class T2> ostream& operator<<(ostream& out, map <T1, T2> v) { return prnt(out, v); }
template<class T1, class T2> ostream& operator<<(ostream& out, pair<T1, T2> p) { return out << '(' << p.first << ' ' << p.second << ')'; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr << " " << H; debug_out(T...);}
#define dbg(...) cerr << #__VA_ARGS__ << " ->", debug_out(__VA_ARGS__)
#define dbg_v(x, n) do{cerr<<#x"[]: ";for(int _=0;_<n;++_)cerr<<x[_]<<" ";cerr<<'\n';}while(0)
#define dbg_ok cerr<<"OK!\n"
#define ll long long
#define ld long double
#define ull unsigned long long
#define pii pair<int,int>
#define MOD 1000000007
#define zeros(x) x&(x-1)^x
#define fi first
#define se second

const long double PI = acos(-1);

ll n, V[100005], SP[100005];

int main()
{
   ios::sync_with_stdio(false);

   cin >> n;
   for (int i=1; i<=n; i++)
   {
      cin >> V[i];
   }
   sort(V+1, V+n+1);
   for (int i=1; i<=n; i++)
   {
      SP[i] = SP[i-1] + V[i];
   }
   ld ans = 1e18;
   for (int i=1; i<=n; i++)
   {
      ll loc = (2 * i - n);
      ld x;
      if (loc < 0)
         x = 1.0 * V[i+1] / 2;
      else
         x = 1.0 * V[i] / 2;
      ans = min(ans, x * loc - SP[i]);
   }

   cout << setprecision(8) << fixed << (ans + SP[n]) / n;
   return 0;
}