#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
// #include<atcoder/all>
#define rep(i, n) for(long long i = 0;i < (n);i++)
using namespace std;
// using namespace atcoder;
using ll = long long;
using Pii = pair<int, int>;
const ll MOD = 1000000007;
const ll MOD3 = 998244353;
const ll INFl = 10000000000000000;
const int INFi = 1000000000;
const double EPS = 0.0000001;
// using mint = modint1000000007;

int main() {

	int n;
	cin >> n;

	vector<double> a(n);

	rep(i, n) cin >> a[i];

	sort(a.begin(), a.end());

	double x = 0;

	int idx  = n / 2;



	x = a[idx] / 2.0;

	double ans = 0;
	
	rep(i, n) {
		ans += a[i];	
	}

	ans += x * n;

	rep(i, n) {
		if(2 * x > a[i]) {
			ans -=a[i];
		}
		else ans -= 2 * x;
	}
	// cout << ans / (double)n << endl;
	printf("%10lf\n", ans / (double)n);

}
#include<bits/stdc++.h>
#define int ll
#define sz(x) int((x).size())
#define all(x) (x).begin(),(x).end()
using namespace std;
using ll = long long;
using pi = pair<int,int>;
const int inf = 0x3f3f3f3f3f3f3f3f;
const int minf = 0xc0c0c0c0c0c0c0c0;

double A[100100];
double ssum[100100];

signed main() {
    ios::sync_with_stdio(0); cin.tie(0);
    cout<<fixed<<setprecision(10);

    int n; cin>>n;
    for (int i=1; i<=n; i++) cin>>A[i];

    sort(A+1, A+n+1);

    ssum[n+1] = 0;
    for (int i=n; i>=1; i--) {
        ssum[i] = ssum[i+1] + A[i];
    }

    double lo = 0, hi = A[n];

    for (int tt=50; tt; tt--) {
        double le = (lo + lo + hi) / 3;
        double ri = (lo + hi + hi) / 3;

        int x = lower_bound(A+1, A+n+1, le+le) - A;

        int big = n - x + 1;
        int small = n - big;

        double fle = (small - big) * le + ssum[x];

        x = lower_bound(A+1, A+n+1, ri+ri) - A;

        big = n - x + 1;
        small = n - big;

        double fri = (small - big) * ri + ssum[x];

        if (fle > fri) lo = le;
        else hi = ri;
    }

    int x = lower_bound(A+1, A+n+1, lo+lo) - A;

    int big = n - x + 1;
    int small = n - big;

    double res = (small - big) * lo + ssum[x];

    cout<<res/n<<'\n';

    return 0;
}