#include <bits/stdc++.h>
using namespace std;
const int N = 2010;
const int inf = ~0U >> 1;
int n, a[N];
double p[5010], q[10010];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", a + i);
  sort(a, a + n);
  double meta = 1.0 / (n * (n - 1) / 2);
  for (int i = 1; i < n; ++i) {
    for (int j = 0; j < i; ++j) {
      p[a[i] - a[j]] += meta;
    }
  }
  for (int i = 0; i <= 5000; ++i)
    for (int j = 0; j <= 5000; ++j) q[i + j] += p[i] * p[j];
  for (int i = 1; i <= 10000; ++i) q[i] += q[i - 1];
  double ans = 0;
  for (int i = 1; i < n; ++i) {
    for (int j = 0; j < i; ++j) {
      ans += q[a[i] - a[j] - 1] * meta;
    }
  }
  printf("%.10f", ans);
  return 0;
}
