#include <bits/stdc++.h>
using namespace std;
double find_max(const vector<double>& vs, bool print = false);
double reduce(const vector<double>& vs, size_t const i0) {
  vector<double> vs2;
  int i, n = vs.size();
  vs2.reserve(n / 2 + 1);
  for (i = 0; i + 1 < n; i += 2) {
    double a, b, c;
    size_t ii = (i + i0) % n;
    a = vs[ii];
    b = vs[ii + 1];
    c = (a + b) / 2;
    vs2.push_back(c);
  }
  for (; i < n; ++i) {
    vs2.push_back(vs[(i + i0) % n]);
  }
  return find_max(vs2);
}
inline double find_max_2(const vector<double>& vs) {
  return (vs[0] + vs[1]) / 2;
}
double find_max(const vector<double>& vs, bool print) {
  double s_max = 0;
  const size_t n = vs.size();
  switch (n) {
    case 2:
      return find_max_2(vs);
    default:
      break;
  }
  for (size_t i = 0; i < n; ++i) {
    double s = reduce(vs, i);
    if (s > s_max) s_max = s;
  }
  return s_max;
}
int main() {
  size_t n;
  cin >> n;
  vector<double> vs;
  vs.reserve(n);
  for (size_t i = 0; i < n; ++i) {
    double v;
    cin >> v;
    vs.push_back(v);
  }
  double s = find_max(vs, true);
  cout << s << endl;
  return 0;
}
