#include <bits/stdc++.h>
using namespace std;
long long sum[5005];
int a[5005], num[5005], rest;
double all, ans, tmp;
int n, i, j, s;
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%d", &a[i]);
  sort(a + 1, a + n + 1);
  all = 2. / n / (n - 1);
  all = all * all * all;
  for (i = 1; i < n; i++)
    for (j = i + 1; j <= n; j++) num[a[j] - a[i]]++;
  for (sum[0] = num[0], i = 1; i <= 5000; i++) sum[i] = sum[i - 1] + num[i];
  for (s = 1; s <= 5000; s++)
    for (i = 0; i < s; i++) {
      rest = s - i;
      tmp = num[s] * num[i] * sum[rest - 1] * all;
      if (tmp > 0) ans += tmp;
    }
  printf("%.10f\n", ans);
}
