#include <bits/stdc++.h>
using namespace std;
const int maxn = 2005, maxm = 10010, off = 5002;
long double dif1[maxm], dif2[maxm], pre[maxm], ans;
int n, val[maxn];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> val[i];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      if (i != j)
        dif1[val[i] - val[j] + off] += ((long double)1 / (((n) * (n - 1)) / 2));
  for (int i = 1; i < off; i++)
    for (int j = -off + 2; j <= -1; j++) {
      dif2[i + j + off] += dif1[i + off] * dif1[j + off];
    }
  pre[0] = dif2[0];
  for (int i = 1; i < maxm; i++) pre[i] = +dif2[i] + pre[i - 1];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      if (val[i] > val[j]) {
        int x = val[j] - val[i];
        ans += (((long double)1 / (((n) * (n - 1)) / 2)) * pre[x - 1 + off]);
      }
  cout << fixed << setprecision(12) << ans;
  return 0;
}
