#include <bits/stdc++.h>
using namespace std;
long long v[20001];
long long dif[5001], a[10000], sum[10001];
int main() {
  ios_base::sync_with_stdio(0);
  int i, y, j, n, m;
  long long t = 0;
  cin >> n;
  for (i = 0; i < n; i++) cin >> v[i];
  memset(dif, 0, sizeof(dif));
  memset(a, 0, sizeof(a));
  for (i = 0; i < n; i++) {
    for (j = i + 1; j < n; j++) dif[abs(v[i] - v[j])]++, t++;
  }
  long long ans = 0;
  for (i = 0; i <= 4999; i++) {
    if (dif[i]) {
      for (j = 0; j <= 4999; j++) {
        if (dif[j]) a[i + j] += dif[i] * dif[j];
      }
    }
  }
  sum[0] = 0;
  for (i = 0; i <= 9999; i++) sum[i + 1] = sum[i] + a[i];
  long long aux = 1;
  long long t2 = t * t;
  t = t2 * t;
  for (i = 0; i <= 4999; i++) {
    if (dif[i]) {
      aux = dif[i] * sum[i];
      ans += aux;
    }
  }
  cout.precision(10);
  cout << fixed << (double)ans / t << "\n";
  return 0;
}
