#include <bits/stdc++.h>
unsigned A[2222], W[11111], S[11111];
int main() {
  unsigned n, i = -1, j, k = 0;
  double m, lo = 0.0, hi = 0.0;
  for (scanf("%u", &n); ++i < n; scanf("%u", A + i))
    ;
  for (i = -1; ++i < n;)
    for (j = i; ++j < n; ++k) ++W[A[i] > A[j] ? A[i] - A[j] : A[j] - A[i]];
  for (i = 10000; i--;) S[i] = S[i + 1] + W[i];
  for (i = -1; ++i < 5005;)
    for (j = -1; ++j < 5005;) {
      m = ((double)W[i]) * ((double)W[j]);
      lo += m * ((double)S[i + j + 1]);
      hi += m * ((double)k);
    }
  printf("%.10lf\n", lo / hi);
  return 0;
}
