#include <bits/stdc++.h>
using namespace std;
int n, i, j, a[2002];
double p[5005], sp[5005], m, res;
int main() {
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d", &a[i]);
  sort(a, a + n);
  for (i = 0; i < n; i++)
    for (j = 0; j < i; j++) p[a[i] - a[j]]++;
  m = (n - 1) * n / 2;
  for (i = 5000; i >= 0; i--) {
    p[i] = p[i] / m;
    sp[i] = sp[i + 1] + p[i];
  }
  for (i = 1; i < 5000; i++)
    for (j = 1; i + j < 5000; j++) res += p[i] * p[j] * sp[i + j + 1];
  printf("%.6lf\n", res);
}
