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