#include <bits/stdc++.h>
using namespace std;
const int N = 2010;
int n, m;
int a[N];
struct node {
  int x;
  double y;
  bool operator<(const node& cmp) const { return x < cmp.x; }
} b[N * N];
double aa[5100];
void ADD(int x, double c) {
  for (int i = x; i <= m; i += i & (-i)) aa[i] += c;
}
double SUM(int x) {
  double s = 0;
  for (int i = x; i > 0; i -= i & (-i)) s += aa[i];
  return s;
}
int bin(int l, int r, int x) {
  if (b[m].x <= x) return -1;
  int res;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (b[mid].x <= x)
      l = mid + 1;
    else {
      r = mid - 1;
      res = mid;
    }
  }
  return res;
}
int main() {
  while (scanf("%d", &n) != EOF) {
    for (int i = 0; i < n; i++) scanf("%d", a + i);
    sort(a, a + n);
    int bn = 0;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < i; j++) {
        b[++bn].x = a[i] - a[j];
        b[bn].y = 1.0 / n;
      }
    }
    sort(b + 1, b + bn + 1);
    m = 1;
    for (int i = 2; i <= bn; i++) {
      if (b[i].x != b[i - 1].x) {
        b[++m].x = b[i].x;
        b[m].y = b[i].y;
      } else {
        b[m].y += b[i].y;
      }
    }
    memset(aa, 0, sizeof(aa));
    for (int i = 1; i <= m; i++) ADD(i, b[i].y);
    double ans = 0;
    for (int i = 1; i <= m; i++) {
      for (int j = 1; j <= m; j++) {
        int xx = b[i].x + b[j].x;
        int index = bin(1, m, xx);
        if (index != -1) {
          if (index > 1)
            ans += b[i].y * b[j].y * (SUM(m) - SUM(index - 1));
          else
            ans += b[i].y * b[j].y * SUM(m);
        }
      }
    }
    printf("%.10f\n", ans);
  }
  return 0;
}
