#include <bits/stdc++.h>
using namespace std;
const int MaxN = 2000;
int n, tot, a[MaxN + 5], b[MaxN + 5];
int cnt[MaxN * 3 + 5], l[MaxN * 3 + 5], pred[MaxN * 3 + 5];
long long sum, fm, fz;
void Init() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n - 1; i++)
    for (int j = i + 1; j <= n; j++) {
      int t = abs(a[i] - a[j]);
      if (cnt[t] == 0) b[++tot] = t;
      cnt[t]++;
    }
  sort(b + 1, b + tot + 1);
  for (int i = 1; i <= tot; i++) pred[i] = pred[i - 1] + cnt[b[i]];
  sum = (n * (n - 1)) / 2;
  fm = sum * sum * sum;
}
void Solve() {
  double ans;
  for (int i = 1; i <= tot; i++) {
    long long t = 0;
    for (int j = 1; j <= i - 1; j++) {
      while ((l[j] < j) && (b[l[j] + 1] + b[j] < b[i])) l[j]++;
      t = t + (2 * (long long)pred[l[j]] * cnt[b[j]]);
      if (l[j] == j) t--;
    }
    fz = fz + (t * cnt[b[i]]);
  }
  ans = fz * 1.0 / sum;
  ans = ans * 1.0 / sum;
  ans = ans * 1.0 / sum;
  printf("%.10lf\n", ans);
}
int main() {
  Init();
  Solve();
}
