#include <bits/stdc++.h>
using namespace std;
const int N = 2020, M = 5050;
int n, i, j, a[N];
double p, dp[3][M * 4];
unordered_map<int, int> frq;
double solve(int round = 0, int diff = M) {
  if (round >= 3) return (diff < M);
  double& ret = dp[round][diff];
  if (ret == ret) return ret;
  ret = 0;
  for (auto it : frq)
    ret += solve(round + 1, diff + it.first * (round < 2 ? 1 : -1)) * p *
           it.second;
  return ret;
}
int main() {
  cin >> n;
  for (i = 0; i < n; ++i) cin >> a[i];
  p = 2.0 / (n * (n - 1));
  sort(a, a + n);
  memset(dp, -1, sizeof(dp));
  for (i = 1; i < n; ++i)
    for (j = 0; j < i; ++j) frq[a[i] - a[j]]++;
  printf("%0.10lf", solve());
  return 0;
}
