#include <bits/stdc++.h>
using namespace std;
int n, a[2055];
long long tot, cnt[5055], p[5055];
long double ans;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  sort(a, a + n);
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++) cnt[a[j] - a[i]]++;
  for (int i = 1; i <= 5000; i++) p[i] = p[i - 1] + cnt[i];
  for (int i = 3; i <= 5000; i++)
    for (int j = 1; j <= i - 2; j++) tot += cnt[i] * cnt[j] * p[i - j - 1];
  ans = tot;
  ans /= (long double)p[5000];
  ans /= (long double)p[5000];
  ans /= (long double)p[5000];
  printf("%.12Lf\n", ans);
  return 0;
}
