#include <bits/stdc++.h>
using namespace std;
long long a[2100], s, f[5100], ft[5100];
double ans = 0;
int main() {
  long long n;
  scanf("%lld", &n);
  long long t = n * (n - 1) / 2;
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
  }
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++) {
      s = abs(a[i] - a[j]);
      f[s]++;
    }
  for (int i = 1; i <= 5000; i++) {
    ft[i] = ft[i - 1] + f[i];
  }
  for (int i = 1; i <= 5000; i++) {
    for (int j = 1; j <= i; j++) {
      ans += (double)f[i] / t * (double)f[j] / t * (double)ft[i - j - 1] / t;
    }
  }
  printf("%.10lf", ans);
  return 0;
}
