#include <bits/stdc++.h>
int main() {
  const long N = 5017;
  long long n;
  scanf("%lld", &n);
  std::vector<long long> a(n);
  for (long long p = 0; p < n; p++) {
    scanf("%lld", &a[p]);
  }
  sort(a.begin(), a.end());
  std::vector<long long> diff(N, 0);
  for (long long p = 0; p < n; p++) {
    for (long long q = p + 1; q < n; q++) {
      ++diff[a[q] - a[p]];
    }
  }
  std::vector<long long> ds(2 * N, 0);
  for (long long p = N - 1; p >= 0; p--) {
    ds[p] = ds[p + 1] + diff[p];
  }
  long long cnt(0);
  for (long long p = 0; p < N; p++) {
    if (diff[p] <= 0) {
      continue;
    }
    for (long long q = 0; p + q < N; q++) {
      if (diff[q] <= 0) {
        continue;
      }
      cnt += diff[p] * diff[q] * ds[p + q + 1];
    }
  }
  long long m = (n * (n - 1) / 2);
  double prob = 1.0 * cnt / (m * m * m);
  printf("%.8lf\n", prob);
  return 0;
}
