#include <iostream>
#include <vector>
#include <string>
#include <array>
#include <functional>
#include <algorithm>
#include <stack>
#include <map>
#include <set>
#include <climits>
#include <queue>
#include <bitset>
#include <cassert>
#include <math.h>
#include <complex>
#include <iomanip>
#include <unordered_map>
using namespace std;
#define ll long long
#define pb(x) push_back(x)

template<typename T1> 
void dbg_pr(vector<T1> V, int add = 0, int start = -1, int end = -1) {
    cout << "{";
    if (start < 0) start = 0;
    if (end < 0) end = V.size() - 1;
    for (int i = start; i <= end; i++) {
        cout << V[i] + add << ((i == end) ? "}" : " ");
    }
}
void dbg_pr(string V) {cout << "\"" << V << "\"";}
template<typename T1> 
void dbg_pr(T1 V) {cout << V;}
template<typename T1, typename T2> 
void dbg_pr(map<T1, T2> M) {
    cout << "{";
    for(const auto m : M) {
        dbg_pr(m.first);
        cout << ":";
        dbg_pr(m.second);
        cout << ",";
    }
    cout << "}";
}
#ifdef _OLIMPOLOCAL
    #define dbg(...) cerr << "\033[1;36m[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
    #define dbg(...) 1337
#endif
void debug_out() { cout << "\033[0m\n";}
template<typename T1, typename... T2> void debug_out(T1 A, T2... B) { cout << " "; dbg_pr(A); debug_out(B...); }
int test = 1;
#define out(x) {cout << x << "\n";return;}
#define all(N) N.begin(),N.end()
#define allr(N) N.rbegin(),N.rend()
void setupFastCin() {ios::sync_with_stdio(false);cin.tie(0);}

template<typename T1> 
T1 chmin(T1 &x, const T1 v) { return x = min(x,v); }
template<typename T1> 
T1 chmax(T1 &x, const T1 v) { return x = max(x,v); }
template<typename T1> 
void pr(vector<T1> V, int add = 0, int start = -1, int end = -1) {
    if (start < 0) start = 0;
    if (end < 0) end = V.size() - 1;
    for (int i = start; i <= end; i++) {
        cout << V[i] + add << ((i == end) ? "\n" : " ");
    }
}
#define rep(i, n) for (int i = 0; i < n; i++)
#define reps(i, s, n) for (int i = s; i < n; i++)
#define repr(i, n) for (int i = n-1; i >= 0; i--)
#define repsr(i, s, n) for (int i = n-1; i >= s; i--)
#define PI pair<int,int>
#define PLL pair<ll, ll>
template<typename T1> 
T1 gcd(const T1 &a, const T1 &b) {
    if (a == 0 || b == 0) return a + b;
    return gcd(b, a %b);
}
//-------------------------- ^ DONT TOUCH ^-----------------------------------------------------------------

#define MAX 1000000
#define MAXP 21
//#define MOD 998244353ll
#define MOD 1000000007ll

long long power(long long x, long long n) {
    long long p = x;
    long long s = 1;
    while (n > 0) {
        if (n & 1) s = (s * p) % MOD;
        p = (p * p) % MOD;
        n /= 2;
    }
    return s;
}


int n;
ll N[MAX];

double val(double x) {
    double s = -x;
    rep(i,n) {
        s += min((double)N[i], 2 * x) / n;
    }
    //dbg(x, s);
    return s;
}

void solve() {
    cin >> n;
    double s = 0;
    double hi = 0;
    double lo = 0;
    rep(i,n) {
        cin >> N[i];
        s -= N[i];
        chmax(hi, N[i] * 2.0 + 1);
    }

    rep(kk, 100) {
        double sz = (hi - lo) / 3;
        double m1 = lo + sz;
        double m2 = hi - sz;
        if (val(m1) < val(m2)) lo = m1;
        else hi = m2;
    }
    double ans = s / n + val(lo);
    printf("%.10lf\n", -ans);
}

int main() {
    setupFastCin();
    int T = 1;
#ifdef _OLIMPOLOCAL
    cin >> T;
#endif
    reps(t, 1, T + 1){
        solve();
    }
        
    return 0;
}
#include <bits/stdc++.h>

#if MYDEBUG
#include "lib/cp_debug.hpp"
#else
#define DBG(...) ;
#endif
#if __cplusplus <= 201402L
template <typename T>
T gcd(T a, T b) { return ((a % b == 0) ? b : gcd(b, a % b)); }
template <typename T>
T lcm(T a, T b) { return a / gcd(a, b) * b; }
#endif
using LL = long long;
constexpr LL LINF = 334ll << 53;
constexpr int INF = 15 << 26;
constexpr LL MOD = 1E9 + 7;

namespace Problem {
using namespace std;

class Solver {
 public:
  int n;
  vector<double> a;
  Solver(LL n) : n(n), a(n){};

  void solve() {
    for (int i = 0; i < n; ++i) {
      cin >> a[i];
    }
    sort(a.begin(), a.end());
    double x = a[n / 2] / 2;
    double ans = 0;
    for (int i = 0; i < n; ++i) {
      ans += x + a[i] - min(a[i], 2.0 * x);
    }
    cout << ans / n << endl;
  }
};

}  // namespace Problem

int main() {
  std::cin.tie(0);
  std::ios_base::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(12);
  long long n = 0;
  std::cin >> n;

  Problem::Solver sol(n);
  sol.solve();
  return 0;
}
