#include <bits/stdc++.h>
using namespace std;
double t;
int n, a[1000000 + 100], sum1, sum2;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  sort(a + 1, a + n + 1);
  sum1 += 2 * a[2];
  sum2 += 2 * a[1];
  if (sum2 + a[n] <= sum1 + a[1]) {
    t = 0 / 1;
    printf("%.10lf", t);
  } else {
    t = (1.0 * 1 / n) * (1.0 * 1 / n) * (1.0 * (n - 1)) / (n);
    printf("%.10lf", t);
  }
  return 0;
}
