#include <bits/stdc++.h>
using namespace std;
int a[5555];
int sum[11111];
int res[11111];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++) {
      int v = abs(a[i] - a[j]);
      sum[v]++;
    }
  res[11110] = 0;
  for (int i = 11109; i >= 0; i--) {
    res[i] = res[i + 1] + sum[i];
  }
  double answ = 0;
  double d = (n * (n - 1)) / 2;
  d = d * d * d;
  for (int i = 0; i < 10100; i++)
    for (int j = i; j < 10100; j++) {
      if (i + j + 1 < 11111) {
        if (sum[i] * sum[j] * res[i + j + 1] != 0)
          answ += 1LL * sum[i] * sum[j] * res[i + j + 1] / (d);
      }
    }
  printf("%.12f\n", answ);
  return 0;
}
