#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];
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++)
      dif[a[j] - a[i]] += 1.0 / (double)n / (double)n;
  }
  for (int i = 1; i < 5001; i++) dif[i] += dif[i - 1];
  long double ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      ans += 2.0 * dif[a[j] - a[i] - 1] * 1.0 / (double)n / (double)n;
    }
  }
  printf("%.9f", ans);
  return 0;
}
