#include <bits/stdc++.h>
using namespace std;
int n;
int a[2005];
double memo[4][60000];
int win1[12000];
int win2[12000];
int mx;
double calcMemo(int i, int cur) {
  double &ret = memo[i][cur];
  if (ret == ret) return ret;
  ret = 0;
  if (i == 2) {
    for (int j = cur + 1; j <= 5000; j++) {
      if (win1[j] == 0) continue;
      ret += ((double)win1[j] / (mx));
    }
    return ret;
  }
  for (int j = 1; j <= 5000; j++) {
    if (!win1[j]) continue;
    ret += ((double(win1[j]) / (mx)) * (calcMemo(i + 1, cur + j)));
  }
  return ret;
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  memset(memo, -1, sizeof memo);
  sort(a, a + n);
  for (int i = 1; i < n; i++)
    for (int j = 0; j < i; j++) win1[a[i] - a[j]]++, mx++;
  double ans = calcMemo(0, 0);
  cout.precision(6);
  cout << fixed << ans << "\n";
  return 0;
}
