#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
const int MN = 15000 + 10;
const int ME = 30000 + 10;
const int mod = 1000000007;
const int Intmax = (~(1 << 31));
const int Intmin = (1 << 31);
const long long LLmax = (~(1LL << 63));
const long long LLmin = (1LL << 63);
const unsigned long long ULLmax = (~(0ULL));
long long cnt2[MN], cnt1[MN];
long long a[MN];
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    int i;
    for (i = 0; i < n; i++) scanf("%I64d", &a[i]);
    int j;
    for (i = 0; i < n; i++) {
      for (j = 0; j < n; j++) {
        if (i == j) continue;
        if (a[i] > a[j]) {
          cnt2[a[i] - a[j]]++;
        }
      }
    }
    for (i = 1; i <= 5000; i++) {
      for (j = 1; j <= 5000; j++) {
        cnt1[i + j] = cnt2[i] * cnt2[j];
      }
    }
    for (i = 1; i <= 10000; i++) cnt1[i] = cnt1[i] + cnt1[i - 1];
    long long ans = 0;
    for (i = 1; i <= 10000; i++) {
      if (cnt1[i]) ans = ans + cnt2[i + 1] * cnt1[i];
    }
    long long p = (n * (n - 1)) / 2;
    printf("%.9f\n", (double)ans / p / p / p);
  }
  return 0;
}
