#include <bits/stdc++.h>
long long a, b;
int n, A[2003], C[10004], S[10004];
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]) S[A[i] - A[h]] = ++C[A[i] - A[h]];
  for (int i = 5000; i > 0; i--) S[i] += S[i + 1];
  for (int i = 0; i < 5000; i++)
    for (int h = i; h < 5000; h++) a += C[i] * C[h] * S[i + h + 1];
  b = n * (n - 1) / 2;
  b = b * b * b;
  printf("%.10lf", (double)a / b);
}
