#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const double eps = 1e-6;
const int inf = 0x3f3f3f3f;
const long long INF = 100000000000000000ll;
const int MAXN = 2010;
const int MAXM = 300030;
int a[MAXN];
long long d[5005];
long long da[5005];
int main() {
  int n;
  scanf("%d", &n);
  memset(d, 0, sizeof(d));
  memset(da, 0, sizeof(da));
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (i != j) {
        if (a[i] > a[j]) {
          d[a[i] - a[j]]++;
        }
      }
    }
  }
  for (int i = 0; i < 5000; i++) {
    for (int j = 0; j < 5000; j++) {
      if (i + j < 5000) {
        da[i + j] += d[i] * d[j];
      }
    }
  }
  long long all = 0;
  for (int i = 1; i < 5000; i++) da[i] += da[i - 1];
  for (int i = 2; i < 5000; i++) all += da[i - 1] * d[i];
  double ans = 0;
  ans = (double)all / (pow(1.0 * n * (n - 1) / 2, 3.0));
  printf("%.10lf\n", ans);
  return 0;
}
