#include <bits/stdc++.h>

#define fi first
#define se second
#define DB double
#define U unsigned
#define P std::pair
#define LL long long
#define LD long double
#define pb emplace_back
#define MP std::make_pair
#define SZ(x) ((int)x.size())
#define all(x) x.begin(),x.end()
#define CLR(i,a) memset(i,a,sizeof(i))
#define FOR(i,a,b) for(int i = a;i <= b;++i)
#define ROF(i,a,b) for(int i = a;i >= b;--i)
#define DEBUG(x) std::cerr << #x << '=' << x << std::endl

const int MAXN = 1e5 + 5;
int n,a[MAXN];

int main(){
	scanf("%d",&n);LL sm = 0,now = 0;
	FOR(i,1,n) scanf("%d",a+i),sm += a[i];
	std::sort(a+1,a+n+1);
	LL ans = 1e18;
	FOR(i,1,n){
		// 2x = a[i]
		now += a[i];
		ans = std::min(ans,2ll*sm+1ll*a[i]*n-2ll*now-2ll*(n-i)*a[i]);
	}
	printf("%.10f\n",1.0*ans/(2*n));
	return 0;
}

#include <bits/stdc++.h>

#define Mod 1000000007

using namespace std;



typedef long long ll;
 
 
inline int read() {
	int out = 0;
	bool flag = false;
	register char cc = getchar();
	while (cc < '0' || cc > '9') {
		if (cc == '-') flag = true;
		cc = getchar(); 
	}
	while (cc >= '0' && cc <= '9') {
		out = (out << 3) + (out << 1) + (cc ^ 48);
		cc = getchar();
	}
	return flag ? -out : out;
}
 
inline void write(int x, char ch) {
	if (x < 0) putchar('-'), x = -x;
	if (x == 0) putchar('0');
	else {
		int num = 0;
		char cc[22];
		while (x) cc[++num] = x % 10 + 48, x /= 10;
		while (num) putchar(cc[num--]);
	}
	putchar(ch);
}

int fpow(int x, int y) {
	int res = 1;
	while (y) {
		if (y & 1) res = 1ll * res * x % Mod;
		x = 1ll * x * x % Mod;
		y >>= 1;
	}
	return res;
}

const int N = 1e5 + 10;

void inc(int &x, int y) {
	x += y; if (x >= Mod) x -= Mod;	
}

int n, a[N]; double ans = 1e15, sum, p;

int main() {
	n = read();
	for (int i = 1; i <= n; i++) a[i] = read(), p += a[i];
	sort(a + 1, a + n + 1);
	for (int k = 0; k < n; k++) {
		sum += a[k];
		if (2 * k - n < 0) {
			ans = min(ans, -sum + (2.0 * k - n) * (a[k + 1] * 0.5));	
		}
		else ans = min(ans, -sum + (2.0 * k - n) * (a[k] * 0.5));	
	}
	ans += p; ans /= n;
	printf("%.10lf", ans);
	return 0;
}