#include <bits/stdc++.h>
using namespace std;
long long prob[15005], prob2[15005], acum[15005];
int v[15005];
int main() {
  long long n;
  int i, j;
  scanf("%lld", &n);
  for (i = 0; i < n; i++) scanf("%d", &v[i]);
  long long total =
      ((n * (n - 1LL)) / 2) * ((n * (n - 1LL)) / 2) * ((n * (n - 1LL)) / 2);
  sort(v, v + n);
  for (i = 0; i < n; i++)
    for (j = i + 1; j < n; j++) prob[v[j] - v[i]]++;
  for (i = 1; i <= 5000; i++)
    for (j = 1; j <= 5000; j++) prob2[i + j] += (prob[i] * prob[j]);
  for (i = 1; i <= 10000; i++) acum[i] = prob2[i], acum[i] += acum[i - 1];
  long long favoraveis = 0LL;
  for (i = 1; i <= 5000; i++) favoraveis += (prob[i] * acum[i - 1]);
  printf("%.10lf\n", (double)((favoraveis * 1.) / (total * 1.)));
}
