#include <bits/stdc++.h>
using namespace std;
const int N = 2e6 + 100;
template <class T>
T sqr(T x) {
  return x * x;
}
int n, a[10000];
long double dif[10000], df[10000];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      df[a[j] - a[i]] += 1;
    }
  }
  int k = n * (n - 1) / 2;
  for (int i = 1; i < 5001; i++) {
    for (int j = 1; j < 5001; j++) {
      dif[j + i] += (df[i] * df[j]) / k / k;
    }
  }
  for (int i = 2; i < 5001; i++) dif[i] += dif[i - 1];
  long double ans = 0;
  for (int i = 1; i < 5001; i++) {
    ans += df[i] * dif[i - 1] / k;
  }
  printf("%.9f", ans);
  return 0;
}
