#include <bits/stdc++.h>
const int N = 2020;
const int M = 5050, M2 = M + M;
int c[2][M2];
int a[N];
int n;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", &a[i]);
  std::sort(a, a + n);
  for (int i = 0; i < n; ++i)
    for (int j = i + 1; j < n; ++j) ++c[0][a[j] - a[i]];
  for (int i = 1; i < M2; ++i)
    for (int j = 1; i + j < M2; ++j) c[1][i + j] += c[0][i] * c[0][j];
  long long k = 0;
  for (int i = 1; i < M; ++i)
    for (int j = i + 1; j < M; ++j) k += c[1][i] * c[0][j];
  long long all = 1LL * (n - 1) * n / 2LL;
  all = all * all * all;
  printf("%.12lf\n", (double)k / all);
  return 0;
}
