#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int n;
int a[N], cnt[N], sum[N];
int main() {
  int i, j;
  while (~scanf("%d", &n)) {
    for (i = 0; i < n; i++) {
      scanf("%d", &a[i]);
    }
    sort(a, a + n);
    for (i = 0; i < n - 1; i++) {
      for (j = i + 1; j < n; j++) {
        cnt[a[j] - a[i]]++;
      }
    }
    for (i = 1; i <= 5000; i++) sum[i] = cnt[i] + sum[i - 1];
    double tmp, b = 0.0;
    for (i = 3; i <= 5000; i++) {
      if (cnt[i] == 0) continue;
      tmp = 0.0;
      for (j = 1; j < i - 1; j++) {
        tmp += 1.0 * cnt[j] * sum[i - j - 1];
      }
      b += cnt[i] * tmp;
    }
    int t = n * (n - 1) / 2;
    printf("%.10lf\n", b / (t * t * t));
  }
  return 0;
}
