// #define LOCAL
#define _USE_MATH_DEFINES
#include <array>
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>
#include <functional>
#include <random>
#include <ctime>

using namespace std;

template <typename A, typename B>
ostream& operator <<(ostream& out, const pair<A, B>& a) {
  out << "(" << a.first << "," << a.second << ")";
  return out;
}
template <typename T, size_t N>
ostream& operator <<(ostream& out, const array<T, N>& a) {
  out << "["; bool first = true;
  for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "]";
  return out;
}
template <typename T>
ostream& operator <<(ostream& out, const vector<T>& a) {
  out << "["; bool first = true;
  for (auto v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "]";
  return out;
}
template <typename T, class Cmp>
ostream& operator <<(ostream& out, const set<T, Cmp>& a) {
  out << "{"; bool first = true;
  for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "}";
  return out;
}
template <typename U, typename T, class Cmp>
ostream& operator <<(ostream& out, const map<U, T, Cmp>& a) {
  out << "{"; bool first = true;
  for (auto& p : a) { out << (first ? "" : ", "); out << p.first << ":" << p.second; first = 0;} out << "}";
  return out;
}
#ifdef LOCAL
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
#else
#define trace(...) 42
#endif
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}

template <class T> auto vect(const T& v, int n) { return vector<T>(n, v); }
template <class T, class... D> auto vect(const T& v, int n, D... m) {
  return vector<decltype(vect(v, m...))>(n, vect(v, m...));
}

typedef long long int64;
typedef pair<int, int> ii;
#define SZ(x) (int)((x).size())
template <typename T> static constexpr T inf = numeric_limits<T>::max() / 2;
const int MOD = 1e9 + 7;
mt19937 mrand(random_device{}());
int rnd(int x) { return mrand() % x; }

struct fast_ios {
  fast_ios() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
  };
} fast_ios_;

int main() {
  int n;
  cin >> n;
  vector<double> a(n);
  for (auto& x : a) cin >> x;
  sort(a.begin(), a.end());
  trace(a);
  vector<double> pre(n + 1);
  for (int i = 0; i < n; ++i) pre[i + 1] = pre[i] + a[i];
  double ret = 1e300, cur;
  // 2x <= a[0]
  cur = pre[n] / n - a[0] / 2;
  ret = min(ret, cur);
  // 2x >= a[n - 1]
  cur = a[n - 1] / 2;
  ret = min(ret, cur);
  for (int i = 1; i < n; ++i) {
    // a[i - 1] <= 2x <= a[i]
    // n * x + pre[n] - pre[i] - (n - i) * x * 2;
    double x = 2 * i > n ? a[i - 1] / 2 : a[i] / 2;
    cur = (n * x + pre[n] - pre[i] - (n - i) * 2 * x) / n;
    ret = min(ret, cur);
  }
  cout << ret << '\n';
  return 0;
}

#include<iostream>
using namespace std;
double eps=1e-7;
double a[100005];
int n;
double gtval(double x){
	double sum=0;
	for(int i=1;i<=n;i++){
		sum+=x+a[i]-min(a[i],x*2);
	}
	return sum;
}
int main(){
	double mx=0;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a[i];
		mx=max(mx,a[i]);
	}
	double l=0,r=mx,ml,mr;
	while(r-l>eps){
		ml=((double(r-l)))/3.0+l;
		mr=((double(r-l)))/1.5+l;
		//cout<<l<<' '<<ml<<' '<<mr<<' '<<r<<endl;
		double v1=gtval(ml),v2=gtval(mr);
		if(v1<v2)r=mr;
		else l=ml;
	}
	printf("%.10lf",gtval(r)/n);
	return 0;
}
