#include <bits/stdc++.h>
using namespace std;
int items[2005];
int counting[5005];
int main() {
  int n;
  scanf("%i", &n);
  for (int e = 0; e < n; e++) {
    scanf("%i", &items[e]);
  }
  for (int e = 0; e < n; e++) {
    for (int ee = 0; ee < n; ee++) {
      if (0 < items[e] - items[ee] && items[e] - items[ee] <= 5000) {
        counting[items[e] - items[ee]]++;
      }
    }
  }
  auto acc = 0LL, acc2 = 0LL;
  for (int e = 1; e <= 5000; e++) {
    auto acc3 = 0LL;
    for (int ee = 1; ee < e; ee++) {
      acc3 += counting[ee] * counting[e - ee - 1];
    }
    acc2 += acc3;
    acc += acc2 * counting[e];
  }
  printf("%.8f\n", (double)acc / n / n / n);
  return 0;
}
