#include <bits/stdc++.h>
using namespace std;
long long ndp[2100][5];
long long nCr(int n, int r) {
  if (r == 0) return 1;
  if (r == 1) return n;
  if (n == r) return 1;
  if (ndp[n][r] != -1) {
    return ndp[n][r];
  }
  return ndp[n][r] = (nCr(n - 1, r) + nCr(n - 1, r - 1));
}
int n;
long long ara[2010];
long long diff[5010];
long long suff[5010];
int main() {
  std::ios_base::sync_with_stdio(false);
  ;
  cin >> n;
  for (int i = 0; i <= n - 1; i++) {
    cin >> ara[i];
  }
  for (int i = 0; i <= n - 1; i++) {
    for (int j = i + 1; j <= n - 1; j++) {
      diff[abs(ara[i] - ara[j])]++;
    }
  }
  for (int i = 5000; i >= 0; i--) {
    suff[i] = diff[i] + suff[i + 1];
  }
  memset((ndp), -1, sizeof(ndp));
  double allp = nCr(n, 2);
  double ans = 0;
  for (int i = 0; i <= 5000; i++) {
    for (int j = 0; j <= 5000; j++) {
      double yo = (double)diff[i] * (double)diff[j] * (double)suff[i + j + 1];
      ans += yo / allp / allp / allp;
    }
  }
  cout << fixed << setprecision(10) << ans;
  return 0;
}
