#include <algorithm>
#include <array>
#include <cassert>
#include <chrono>
#include <cmath>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <vector>
#include <stack>
	
using namespace std;
 
#define enviar {ios_base::sync_with_stdio(false);}
#define aiuda {cin.tie(NULL); cout.tie(NULL);} 
 
#define F_OR(i, a, b, s) for (int i=(a); (s)>0?i<(b):i>(b); i+=(s))
#define F_OR1(e) F_OR(i, 0, e, 1)
#define F_OR2(i, e) F_OR(i, 0, e, 1)
#define F_OR3(i, b, e) F_OR(i, b, e, 1)
#define F_OR4(i, b, e, s) F_OR(i, b, e, s)
#define GET5(a, b, c, d, e, ...) e
#define F_ORC(...) GET5(__VA_ARGS__, F_OR4, F_OR3, F_OR2, F_OR1)
#define FOR(...) ;F_ORC(__VA_ARGS__)(__VA_ARGS__)
#define EACH(x, a) for (auto& x: a)
#define exacto(v) cout << setprecision(v) << fixed;
 
#define ll int
#define lld long double
#define eb emplace_back
#define em emplace
#define ef emplace_front
#define f first
#define s second
#define big greater<ll>()
#define bpc(x) __builtin_popcount(x)
#define bpc2(x) __builtin_clz(x)
#define bpc3(x) __builtin_ctz(x)
#define DIE(args...) {print(args); return;} 
#define lb lower_bound
#define ub upper_bound

 
#define ar(v)  array<int,v>
#define all(v) v.begin(), v.end()
#define sz(x) (int)(x).size()
#define meminf(v) memset(v,  0x3f , sizeof(v))
#define mem(v,x) memset(v , x , sizeof v);
#define ai(a, n) for (int ele = 0; ele < n; ele++) cin >> a[ele];
#define ao(a, n) {for (int ele = 0; ele < (n); ele++) { if (ele) cout << " "; cout << a[ele]; } cout << '\n';}
#define readgraph(list, edges) for (int i = 0; i < edges; i++) {int n1, n2; cin >> n1 >> n2; n1--; n2--; list[n1].eb(n2); list[n2].eb(n1);}
 
 
template <typename T> struct combinator  {   T t_; combinator(T&& t) : t_(std::forward<T>(t)) {} template <typename... Args> auto operator () (Args&&... args) const  { return t_(*this, std::forward<Args>(args)...); } };
template<class T> bool umin(T& a, const T& b) { return b<a?a=b, 1:0; }
template<class T> bool umax(T& a, const T& b) { return a<b?a=b, 1:0; } 
string to_string(bool b) {return b?"true":"false"; }
string to_string(char c) { return string(1, c);}
string to_string(const char* s) { return string(s); }
string to_string(string s) { return s; }
template<class T> string to_string(T v) { bool f=1; string res; EACH(x, v) { if(!f) res+=' '; f=0; res+=to_string(x); } return res; }
template<class A> void write(A x) { cout << to_string(x); }
void print() { write("\n"); }
template<class H, class... T> void print(const H& h, const T&... t) {  write(h); if(sizeof...(t)) write(' '); print(t...); }
 
 
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pair<ll, ll>> vpll;
typedef vector<pair<int, int>> vpii;
typedef map<ll, ll> mll;
typedef priority_queue<ll, std::vector<ll>, std::greater<ll>> priomin;
typedef priority_queue<int> priomx;

 
const ll mod =   998244353;
//const ll mod =   1e9 + 7;
const ll maxsize =2e5  + 5; 
//const ll inf = 0x3f3f3f3f3f3f3f3f ;

// size, caracter



//int a[maxsize];




void solve()
{
	
	int n ;
	cin >> n;
	vector<double> a(n), b(n);
	
	FOR(i , n)
	{
		cin >> a[i];
		//a[i]/=2;
	}
	
	
	sort(all(a));
	
	partial_sum(all(a), b.begin());
	
	double ans = 1e18;
	
	//ao(b , n);
	FOR(i, n)
	{
		double temp =  b[n-1] - b[i] - (n - 1 - i)*a[i];
		umin(ans , a[i]/2 + temp/n );
		
		
	}
	cout << setprecision(6) << fixed;
	print(ans);
	
}	
 
 
int main(){
	
	enviar aiuda
	
	int tc = 1;
	//cin >> tc;
	
	 
	while(tc--)  solve();
	
	return 0;
} 



		  
		 
		  
		

// Parasparopagraho Jīvānām
 
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
 
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/rope>
 
using namespace  __gnu_pbds ;
using namespace __gnu_cxx ;
using namespace std ; 
 
typedef long long ll ;
typedef long double ldb ;
 
typedef pair<int, int> pii ;
typedef pair<int, ll> pil ;
typedef pair<ll,ll> pll ;
 
typedef vector<int> vi ;
typedef vector<ll> vll ;
typedef vector<pii> vpi ;
typedef vector<pll> vpl ;
typedef vector<bool> vb ; 
typedef vector<pair<ll,int> > vpli ; 
typedef vector<int,pil> edges ;
typedef vector<vi> matrix ; 
typedef priority_queue<int> pqu ; 
 
template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update> ;
 
#define rep(i,a,b) for (int i = (a); i <= (b); i++)
#define per(i,b,a) for (int i = (b); i >= (a); i--)
 
#define mp make_pair
#define eb emplace_back
#define pb push_back
#define pob pop_back 
#define fi first
#define se second
#define ins insert 
#define bk back
#define con continue 
#define lbd lower_bound 
#define ubd upper_bound 
 
#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
 
#define pr cout << // I don't like this but my laptop's 'O' key is not functioning well
 
/* Careful when using long long
__builtin_clz(int x) {} //: the number of zeros at the beginning of the number
__builtin_ctz(int x) {} //: the number of zeros at the end of the number
__builtin_popcount(int x) {} //: the number of ones in the number
__builtin_parity(int x) {} //: the parity (even or odd) of the number of ones */
 
const int mod1 = 1000000007 ;
const int mod2 = 998244353 ;
const ll  infl = 4e18 ;
const int infi = 2e9 ;
const int maxn = 1e6 + 5 ;
const int block = 500 ;
const int logn = 60 ;
const int alpha = 27 ;
const ldb pi = acos(-1) ;
 
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()) ;
int rng_lr(int a, int b)
{
    int ret ;
    ret = uniform_int_distribution<int>(a, b)(rng) ;
    return ret ;
    // For shuffling use shuffle(all, rng) ; 
}
 
ll modpow(ll a, ll b, int MOD) { ll res = 1 ; while(b) { if(b&1) { res = res*a ; res %= MOD ; } a *= a ; a %= MOD ; b >>= 1 ; } return res%MOD ; }
void upmin(int &a, int b) { if(a < b) { a = b ; } }
void relax(int &a, int b) { if(a > b) { a = b ; } }
ll add(ll a, ll b, int MOD) { a += b ; if(a >= MOD) { a -= MOD ; } return  a ; }
ll sub(ll a, ll b, int MOD) { a -= b ; if(a < 0) { a += MOD ; } return a ; }
ll mul(ll a, ll b, int MOD) { b %= MOD ; a *= b ; a %= MOD ; return a ; }
ll inverse(ll a, ll MOD) { a = modpow(a, MOD - 2, MOD) ; return a ; }
ll lcm(ll a, ll b) { ll ret ; ll g = __gcd(a, b) ; ret = a/g ; ret = ret*b ; return ret ; }
int icast(char ch) { return int(ch-'a') ; }
void hyn(int a, int b) { if(a == b) cout << "YES\n" ; else cout << "NO\n" ; } 
void pyd(int a, int b) { if(a == b) cout << "First\n" ; else cout << "Second\n" ; } 

// Check constraints + overflows + types in typedef 

int main() 
{
    ios::sync_with_stdio(false) ;
    cin.tie(NULL) ;  
    int n ; 
    cin >> n ; 
    vi a(n) ; 
    rep(i,0,n-1) {
        cin >> a[i] ; 
    }
    vector<ldb> b(n) ; 
    rep(i,0,n-1) {
        b[i] = ((ldb)a[i])/((ldb)2) ; 
    }
    sort(all(b)) ; 
    ldb x = b[(n-1)/2] ;
    //pr x << "\n" ;  
    ldb ev = ldb(0) ; 
    rep(i,0,n-1) {
        ldb loss = x + (ldb)a[i] - min((ldb)a[i], ((ldb)2)*x) ; 
       // pr loss << "\n" ; 
        ldb contri = ((ldb)loss)/((ldb)n) ; 
        ev = ev + contri ; 
    }
    pr fixed << " " << setprecision(10) ; 
    pr ev << "\n" ; 

    return 0 ; 
}
