#include <bits/stdc++.h>
long long a, b;
int n, A[2003], C[5003], S[5003];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", A + i);
  for (int i = 0; i < n; i++)
    for (int h = 0; h < n; h++)
      if (A[i] > A[h]) C[A[i] - A[h]]++;
  for (int i = 4999; i > 0; i--) S[i] = S[i + 1] + C[i];
  for (int i = 1; i < 5000; i++)
    for (int h = 1; i + h + 1 < 5000; h++)
      a += 1LL * C[i] * C[h] * S[i + h + 1];
  b = n * (n - 1) / 2;
  printf("%.10lf", (double)a / b / b / b);
}
