#include <bits/stdc++.h>
int t[2007];
int roz[5007];
int sumaRoznic[10007];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", &t[i]);
  std::sort(t, t + n);
  for (int i = 1; i < n; ++i)
    for (int j = 0; j < i; ++j) ++roz[t[i] - t[j]];
  for (int i = 0; i <= 5000; ++i)
    for (int j = 0; j <= i; ++j) sumaRoznic[i + j] += std::min(roz[i], roz[j]);
  for (int i = 1; i <= 5000; ++i) sumaRoznic[i] += sumaRoznic[i - 1];
  int res = 0;
  for (int i = 1; i <= 5000; ++i) res += roz[i] * sumaRoznic[i - 1];
  int t = n * (n - 1) / 2;
  printf("%.10lf", 1. * res / (double(t) * double(t) * double(t)));
}
