#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
using P=pair<int,int>;
#define rep(i,n) for(int i=0;i<n;i++)

int main(){
  int n;
  cin >> n;
  vector<ld> a(n);
  rep(i,n) cin >> a[i];
  sort(a.begin(),a.end());
  vector<ld> b=a;
  rep(i,n-1) b[n-i-2]+=b[n-i-1];
  
  if(n==1){
    printf("%.10Lf\n",a[0]/2);
    return 0;
  }
  
  ld ans=0;
  rep(i,n) ans+=a[i]/n;
  
  rep(i,n){
    ld x=a[i]/2;
    int k=-1*n+2*(i+1);
    ans=min(ans,(x*k+b[i+1])/n);
  }
  
  printf("%.10Lf\n",ans);
  
}
#include<bits/stdc++.h>
using namespace std;
long long n,a,b,ans;
int main()
{
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>a>>b;
		ans+=(a+b)*(b-a+1)/2;
	}
	cout<<ans<<endl;
	return 0;
}