#include <bits/stdc++.h>
using namespace std;
const int nmax = 2005;
const int valmax = 5005;
const double EPS = 1e-9;
int n;
double k;
int a[nmax];
int cnt[valmax];
double aib[valmax * 2];
void update(int x, double v) {
  while (x < valmax * 2) {
    aib[x] += v / k / k;
    x += (x & -x);
  }
}
double query(int x) {
  double sum = 0;
  while (x) {
    sum += aib[x];
    x -= (x & -x);
  }
  return sum;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  k = n * (n - 1) / 2;
  sort(a + 1, a + n + 1);
  for (int i = 0; i < valmax; i++) cnt[i] = 0;
  for (int i = 2; i <= n; i++) {
    for (int j = 1; j < i; j++) {
      cnt[a[i] - a[j]]++;
    }
  }
  for (int i = 0; i < valmax; i++) {
    if (!cnt[i]) continue;
    for (int j = 0; j < valmax; j++) {
      if (!cnt[j]) continue;
      update(i + j + 2, 1. * cnt[i] * cnt[j]);
    }
  }
  double ans = 0;
  for (int i = 0; i < valmax; i++) {
    double tmp = 1.;
    tmp *= 1. * cnt[i] / k;
    tmp *= query(i + 1);
    ans += tmp;
  }
  printf("%.15lf\n", ans);
  return 0;
}
