#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const int inf = 0x7fffffff;
int a[2010], round1[5010], round2[10010];
int main() {
  int n;
  scanf("%d", &n);
  int minn = inf, maxn = 0;
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
    maxn = max(maxn, a[i]);
    minn = min(minn, a[i]);
  }
  int k = maxn - minn;
  sort(a, a + n);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < i; ++j) ++round1[a[i] - a[j]];
  }
  for (int i = 1; i <= k; ++i) {
    for (int j = 1; j <= k; ++j) {
      if (i + j > k) continue;
      round2[i + j] += round1[i] * round1[j];
    }
  }
  for (int i = 1; i <= k; ++i) round2[i] += round2[i - 1];
  double sum = 0;
  for (int i = 1; i <= k; ++i) sum += 1.0 * round2[i - 1] * round1[i];
  double nn = n * (n - 1) / 2;
  printf("%lf\n", sum / nn / nn / nn);
  return 0;
}
