#include <bits/stdc++.h>
using namespace std;
int n, a[2005];
double p[5005], suf[5005];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      p[abs(a[i] - a[j])] += 1.0 / (double)(n * (n - 1) / 2);
    }
  }
  suf[5000] = p[5000];
  for (int i = 4999; i >= 0; i--) {
    suf[i] = suf[i + 1] + p[i];
  }
  double ans = 0.0;
  for (int i = 0; i <= 5000; i++) {
    for (int j = 0; j <= 5000; j++) {
      if (i + j >= 5000) continue;
      ans += p[i] * p[j] * suf[i + j + 1];
    }
  }
  printf("%.10f\n", ans);
}
