#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2222;
const int inf = 11000;
int A[MAXN];
int n;
int kum[inf];
int cur[inf];
void load() {
  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]) cur[A[i] - A[j]]++;
    }
  for (int i = inf - 2; i >= 0; i--) kum[i] = kum[i + 1] + cur[i];
}
void solve() {
  double naz = n * (n - 1) / 2;
  naz *= naz * naz;
  long long broj = 0;
  for (int i = 0; i < inf / 2; i++)
    for (int j = 0; j < inf / 2; j++) {
      broj += (long long)cur[i] * cur[j] * kum[i + j + 1];
    }
  printf("%.10f\n", (double)broj / naz);
}
int main() {
  load();
  solve();
  return 0;
}
