#include <bits/stdc++.h>
using namespace std;
long long rdtsc() {
  long long tmp;
  asm("rdtsc" : "=A"(tmp));
  return tmp;
}
inline int myrand() { return abs((rand() << 15) ^ rand()); }
inline int rnd(int x) { return myrand() % x; }
const int INF = (int)1.01e9;
const long double EPS = 1e-9;
const long double PI = acos(-1.0L);
void precalc() {}
int n;
const int maxn = (int)2000 + 10;
int a[maxn];
bool read() {
  if (scanf("%d", &n) < 1) {
    return 0;
  }
  for (int i = 0; i < n; ++i) {
    scanf("%d", a + i);
  }
  return 1;
}
const int maxk = (int)5e3 + 10;
int f[maxk];
long long dp[maxk * 6];
const int shift = maxk * 3;
void solve() {
  memset(f, 0, sizeof(f));
  sort(a, a + n);
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      f[a[j] - a[i]] += 1;
    }
  }
  memset(dp, 0, sizeof(dp));
  dp[shift] = 1;
  for (int iter = 0; iter < 3; ++iter) {
    for (int i = 0; i < 6 * maxk; ++i) {
      int pos = iter == 2 ? i : (6 * maxk - i - 1);
      auto &curv = dp[pos];
      if (curv == 0) {
        continue;
      }
      long long cur = curv;
      curv = 0;
      for (int x = 0; x < maxk; ++x) {
        if (!f[x]) {
          continue;
        }
        dp[pos + (iter == 2 ? -x : x)] += cur * f[x];
      }
    }
  }
  long long sum = n * (n - 1) / 2;
  sum = sum * sum * sum;
  long long whole = 0;
  for (int i = 0; i < shift; ++i) {
    whole += dp[i];
  }
  printf("%.18f\n", (double)((long double)whole / sum));
}
int main() {
  srand(rdtsc());
  precalc();
  while (1) {
    if (!read()) {
      break;
    }
    solve();
  }
  return 0;
}
