#include <bits/stdc++.h>
using namespace std;
int N;
const int NMax = 300005;
const int MaxS = 30;
double Array[NMax];
double ans;
int id[NMax], L[NMax], R[NMax];
inline bool cmp(int a, int b) { return Array[a] < Array[b]; }
void Read() {
  scanf("%d", &N);
  for (int i = 1; i <= N; i++) scanf("%lf", &Array[i]), id[i] = i;
  sort(id + 1, id + N + 1, cmp);
}
void Solve() {
  for (int i = 1; i <= N; i++) L[i] = i - 1, R[i] = i + 1;
  for (int i = 1; i <= N; i++) {
    double cL = 0, cR = 0, cnt = 0;
    double coef = 1, s = 1;
    for (int j = id[i]; j > 0 && cnt <= MaxS; cnt++, j = L[j]) {
      cL += coef * (j - L[j]);
      coef *= 0.5;
      s += j - L[j];
    }
    cnt = 0;
    coef = 1, s = 1;
    for (int j = id[i]; j <= N && cnt <= MaxS; cnt++, j = R[j]) {
      cR += coef * (R[j] - j);
      coef *= 0.5;
      s += R[j] - j;
    }
    ans += cL * cR * Array[id[i]];
    L[R[id[i]]] = L[id[i]];
    R[L[id[i]]] = R[id[i]];
  }
  cout << fixed << setprecision(15) << ans / 2 / N / N;
}
int main() {
  Read();
  Solve();
  return 0;
}
