#include <bits/stdc++.h>
int const N = 5555;
int a[N];
int diff[N + N];
int suff[N + N];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", a + i);
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (a[i] < a[j]) {
        ++diff[a[j] - a[i]];
      }
    }
  }
  for (int i = N; i >= 0; --i) {
    suff[i] = suff[i + 1] + diff[i];
  }
  long long ans = 0;
  for (int d1 = 1; d1 < N; ++d1) {
    for (int d2 = 1; d2 < N; ++d2) {
      ans += (long long)diff[d1] * diff[d2] * suff[d1 + d2 + 1];
    }
  }
  long long den = n * (n - 1) / 2;
  den = den * den * den;
  printf("%.15f\n", (double)ans / den);
}
