#include <bits/stdc++.h>
using namespace std;
int a[2005], b[4000006], n, s[10005];
long long top = 0;
int main() {
  int i, j, p;
  double sum;
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d", &a[i]);
  sort(a, a + n);
  for (i = 1; i < n; i++) {
    for (j = 0; j < i; j++, top++) {
      b[a[i] - a[j]]++;
    }
  }
  sum = 0;
  for (i = 1; i <= 5000; i++) s[i] = s[i - 1] + b[i];
  for (i = 1; i < 5000; i++) {
    if (s[i] == top) break;
    for (j = 1; j <= 5000 - i; j++) {
      sum += b[i] * b[j] * (top - s[i + j]);
    }
  }
  printf("%.10f\n", sum / (top * top * top));
  return 0;
}
