#include <bits/stdc++.h>
int a[2000], d[5000], c[5000];
int cmp(const void *arg1, const void *arg2) {
  return (*(int *)arg1 - *(int *)arg2);
}
int main() {
  int i, j, n;
  long long m, total = 0LL;
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d", &a[i]);
  qsort((void *)a, n, sizeof(int), cmp);
  memset(d, 0, sizeof d);
  memset(c, 0, sizeof c);
  for (i = 0; i < n; i++)
    for (j = i + 1; j < n; j++) d[a[j] - a[i]]++;
  for (i = 1; i < 5000; i++) c[i] = c[i - 1] + d[i];
  for (i = 4999; i; i--)
    for (j = 1; j < i; j++) total += d[i] * d[j] * c[i - j - 1];
  m = n * (n - 1) / 2;
  printf("%.10f\n", (double)total / (m * m * m));
  return 0;
}
