#include <bits/stdc++.h>
using namespace std;
int c[5005];
long long f[5005];
long long suf[5005];
int main() {
  int n;
  while (cin >> n) {
    for (int i = 0; i < n; i++) cin >> c[i];
    sort(c, c + n);
    memset(f, 0, sizeof(f));
    for (int i = 0; i < n; i++)
      for (int j = i + 1; j < n; j++) f[c[j] - c[i]]++;
    long long sum = 0;
    for (int i = 1; i <= 5000; i++) sum += f[i];
    suf[5001] = 0;
    for (int i = 5000; i >= 0; i--) suf[i] = f[i] + suf[i + 1];
    double dev = 0;
    for (int i = 1; i <= 5000; i++) {
      double peso = f[i];
      if (peso == 0) continue;
      double p1 = (peso / sum);
      for (int j = 1; j <= 5000; j++) {
        double peso2 = f[j];
        if (peso2 == 0) continue;
        double p2 = (peso2 / sum);
        double p3 = 0;
        if (i + j < 5000) {
          p3 = (suf[i + j + 1] / (double)sum);
          dev += p1 * p2 * p3;
        }
      }
    }
    printf("%.10lf\n", dev);
  }
  return 0;
}
