#include <bits/stdc++.h>
using namespace std;
const long long maxn = 3e3, maxm = 6e3;
long long a[maxn], b[maxm], f[5][maxm];
long double A;
double ans;
long long n, i, j, cnt, B = 5000, M;
int main() {
  scanf("%lld", &n);
  for (i = 1; i <= n; i++) scanf("%lld", &a[i]);
  sort(a + 1, a + n + 1);
  for (i = 1; i <= n; i++)
    for (j = i + 1; j <= n; j++) b[a[j] - a[i]]++;
  for (i = 1; i <= 5000; i++) f[1][i] = b[i];
  for (i = 1; i <= 5000; i++)
    for (j = 1; j <= 5000; j++) f[2][i + j] = f[1][i] * b[j];
  for (i = 1; i <= 5000; i++)
    for (j = 1; j < i; j++) cnt += b[i] * f[2][j];
  M = n * (n - 1) / 2;
  M = M * M * M;
  A = (long double)cnt / M;
  ans = A;
  printf("%.10lf", ans);
  return 0;
}
