#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
const double EPS = 1e-15;
const double PI = acos(-1.0);
const int MAXN = (int)5e3 + 7;
const int INF = (int)1e9 + 7;
const long long LINF = (long long)2e18 + 7;
const int MOD = (int)1e9 + 7;
const unsigned long long P = 239017;
const unsigned long long MM = (unsigned long long)2147482661;
int solve();
int main() {
  solve();
  return 0;
}
int a[MAXN], dt[MAXN], suff[3 * MAXN];
int solve() {
  int n;
  cin >> n;
  for (int i = 0; i < (int)n; i++) {
    scanf("%d", a + i);
  }
  for (int i = 0; i < (int)n; i++) {
    for (int j = 0; j < (int)i; j++) {
      dt[abs(a[i] - a[j])]++;
    }
  }
  for (int i = MAXN; i >= 0; i--) {
    suff[i] = suff[i + 1] + dt[i];
  }
  long long answer = 0;
  for (int i = 1; i <= (int)MAXN - 1; i++) {
    for (int j = 1; j <= (int)MAXN - 1; j++) {
      if (dt[i] && dt[j]) {
        int cnt1 = dt[i], cnt2 = dt[j];
        int delt = i + j;
        int cnt3 = suff[delt + 1];
        long long nd = cnt1 * cnt2 * cnt3;
        answer += nd;
      }
    }
  }
  double dans = 1.0 * answer / (n * n * n);
  printf("%.10f", dans);
  return 0;
}
