#include <bits/stdc++.h>
using namespace std;
const int M = 100010;
int n;
int a[M], b[M], c[M];
int s1, s2;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  sort(a + 1, a + 1 + n);
  for (int i = n; i >= 1; i--)
    for (int j = i - 1; j >= 1; j--) b[a[i] - a[j]]++;
  for (int i = 1; i <= 5000; i++)
    for (int j = 1; j <= 5000; j++) c[i + j] += b[i] * b[j];
  for (int i = 1; i <= 10000; i++) {
    if (c[i])
      for (int j = i + 1; j <= 5000; j++)
        if (b[j]) s2 += b[j];
  }
  double ans = (double)(s2 * 1.0000 / (n * 1.000 * n * n));
  printf("%.10lf", ans);
  return 0;
}
