#include <bits/stdc++.h>
using namespace std;
int ar[2001];
long long int dif[10001];
long long int uper[10001];
int main() {
  long long int n;
  while (scanf("%lld", &n) != EOF) {
    memset((dif), (0), sizeof(dif));
    for (int i = 0; i < n; i++) {
      ar[i] = ({
        int a;
        scanf("%d", &a);
        a;
      });
    }
    for (int i = 0; i < n; i++) {
      for (int j = i + 1; j < n; j++) {
        dif[abs(ar[i] - ar[j])]++;
      }
    }
    long long int tot = (n * (n - 1)) / 2;
    uper[10000] = 0LL;
    for (int i = 10000 - 1; i >= 1; i--) {
      uper[i] = uper[i + 1] + dif[i + 1];
    }
    double cnt = 0.0;
    long long int div = tot;
    double divv = div * div * div;
    for (int i = 2; i <= 10000; i++) {
      for (int j = 1; j <= (i / 2); j++) {
        double dj = dif[j];
        double dij = dif[i - 1];
        double uj = uper[i];
        cnt += ((dj * dij * uj) / (divv));
      }
    }
    cout << fixed << setprecision(10) << cnt << endl;
  }
}
