#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const int M = 1e9 + 7;
const int N = 2e5 + 5;
double dp[5][30000 + 5];
int vis[5][30000 + 5];
int n, a[2005], nn;
double fun(int t, int l, int r) {
  if (t == 3) return r > l;
  double &ret = dp[t][l];
  if (vis[t][l]) return ret;
  vis[t][l] = 1;
  ret = 0.0;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      if (t < 2)
        ret += (double)1 / nn * fun(t + 1, l + a[j], r + a[i]);
      else
        ret += (double)1 / nn * fun(t + 1, l + a[i], r + a[j]);
    }
  }
  return ret;
}
int main() {
  cin >> n;
  nn = (n * (n - 1)) / 2;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  cout.precision(20);
  cout << fun(0, 0, 0) << endl;
  return 0;
}
