#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const double EPS = 1e-12;
inline int read() {
  static char ch;
  bool sgn = false;
  while (ch = getchar(), ch < '0' || ch > '9')
    if (ch == '-') sgn = true;
  int res = ch - 48;
  while (ch = getchar(), ch >= '0' && ch <= '9') res = res * 10 + ch - 48;
  return sgn ? -res : res;
}
int n, a[5000], b[4000005];
int main() {
  n = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  sort(a + 1, a + 1 + n);
  for (int i = 2; i <= n; i++)
    for (int j = 1; j < i; j++) b[++b[0]] = a[i] - a[j];
  sort(b + 1, b + n * (n - 1) / 2 + 1);
  int M = b[n * (n - 1) / 2];
  double ans = 0;
  for (int i = 2; i <= M; i++) {
    int p = lower_bound(b + 1, b + n * (n - 1) / 2 + 1, i) - b;
    if (p <= n * (n - 1) / 2 && b[p] == i) {
      for (int j = 1; j < i; j++) {
        p = lower_bound(b + 1, b + n * (n - 1) / 2 + 1, j) - b;
        if (p > n * (n - 1) / 2 && b[p] != j) continue;
        long long t1 = upper_bound(b + 1, b + n * (n - 1) / 2 + 1, j) -
                       lower_bound(b + 1, b + n * (n - 1) / 2 + 1, j);
        long long t2 =
            lower_bound(b + 1, b + n * (n - 1) / 2 + 1, i - j) - b - 1;
        ans += t1 * t2;
      }
    }
  }
  printf("%.10f",
         ans / (n * (n - 1) / 2) / (n * (n - 1) / 2) / (n * (n - 1) / 2));
}
