// author: Halit
#include <bits/stdc++.h>

int main() {
  int n;
  std::cin >> n;

  std::vector<int> a(n);
  for (int& el : a) {
    std::cin >> el;
  }

  constexpr double eps = 0.0000001;
  auto check = [&](double x) {
    long double compute = 0;
    for (int a_i : a) {
      compute += x + a_i - std::min(double(a_i), 2*x);
    }

    return compute / n;
  };

  double l = 0, r = 1e9+7;
  for (int i = 1;i <= 100; ++i) {
    double point_1 = (r-l)/3 + l;
    double point_2 = (r-l)/3 * 2 + l;

    if (check(point_2)-check(point_1) > eps) r = point_2;
    else l = point_1;
  }

  double ans = l;
  std::cout << std::fixed << std::setprecision(7) << check(ans);
}
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<map>
#include<math.h>
#include<iostream>
#include<cmath>
#include<queue>
#include<vector>
#define IOS ios::sync_with_stdio(false);cin.tie();cout.tie(0)

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pll;
const int N=1e5+10;
const int mod=1e9+7;
double a[N],s[N];

int main()
{
    IOS;
    int n;
    cin>>n;
    double n1=n*1.0;
    for(int i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    sort(a+1,a+n+1);
    for(int i=1;i<=n;i++)
        s[i]=s[i-1]+a[i];

    double sum=1e18;
    for(int i=1;i<=n;i++)
    {
        double w=a[i]/2;
        double w1=(s[n]-s[i])-(n-i-i)*w;
        sum=min(sum,w1);
        //cout<<sum/n1<<endl;
    }
    printf("%.6lf",sum/n1);
    return 0;
}
