#include <bits/stdc++.h>
using namespace std;

#define fr(i,n) for(int i = 0; i<n; i++)
#define sz(v) (int)(v.size())
#define prin(a) cout << #a << " = " << a << endl
#define prinv(v) cout << #v << " = "; for(auto it : v) cout << it << ", "; cout << endl
#define all(v) (v).begin(),(v).end()

typedef long long ll;

#define rmin(a,b) a = min<ll>(a,b)
#define rmax(a,b) a = max<ll>(a,b)

#define fi first
#define se second

const int N = 1e5+10;
double dp[N];

int main(){
	ios::sync_with_stdio(0); cin.tie(0);
	int n; cin >> n;
	for(int i = 1; i<n; i++){
		dp[i] = (double)((n-i)*(1+dp[i-1])+i)/(n-i);
	}
	cout << fixed << setprecision(10) << dp[n-1] << "\n";
}
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

double check(double d, vector<double>& A) {
  double val=0;
  for(auto& e:A) val+=(d+e-min(e,2*d))/A.size();
  return val;
}

int main() {
  ll N; cin>>N;
  vector<double> A(N);
  for(auto& e:A) cin>>e;
  // 三分探索かなあ
  double low=0, high=1e10;
  ll cnt=1000;
  while(cnt--) {
    double d1=(low*2+high)/3;
    double d2=(low+high*2)/3;
    if(check(d1,A)>check(d2,A)) low=d1;
    else high=d2;
  }
  cout<<fixed<<setprecision(20)<<check(low,A)<<endl;
}
