#include <bits/stdc++.h>
using namespace std;
const int N = 5002;
int n;
double p[5 * N], z[5 * N];
int a[5 * N];
int main(int argc, char const *argv[]) {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  sort(a, a + n);
  double prob = 1.0 / (n * (n - 1) / 2);
  memset(p, 0, sizeof(p));
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      p[a[j] - a[i]] += prob;
    }
  }
  memset(z, 0, sizeof(z));
  for (int i = 1; i < N; ++i) {
    for (int u = 1; u < N; ++u) {
      z[i + u] += p[i] * p[u];
    }
  }
  double ans = 0.0;
  double total = 0.0;
  for (int i = 1; i < N; ++i) {
    ans += p[i] * total;
    total += z[i];
  }
  printf("%.17f\n", ans);
  return 0;
}
