#include <bits/stdc++.h>
using namespace std;
long long a[2005], single[5005], two[10005];
int main() {
  long long i, j, n, m, temp, tot = 0;
  cin >> n;
  temp = (n * (n - 1)) / 2;
  for (i = 1; i <= n; i++) cin >> a[i];
  memset(single, 0, sizeof(single));
  memset(two, 0, sizeof(two));
  sort(a + 1, a + n + 1);
  for (i = n; i > 1; i--) {
    for (j = n - 1; j >= 1; j--) single[a[i] - a[j]]++;
  }
  for (i = 1; i <= 5000; i++) {
    if (single[i] > 0) {
      for (j = i; j <= 5000; j++) {
        if (single[j] > 0) two[i + j] = single[i] * single[j];
      }
    }
  }
  for (i = 1; i <= 10000; i++) two[i] += two[i - 1];
  for (i = 1; i <= 5000; i++) {
    if (single[i] > 0) tot += (single[i] * two[i - 1]);
  }
  float ans = tot * 1.0;
  for (i = 1; i <= 3; i++) {
    ans = (ans * 1.0) / (temp * 1.0);
  }
  printf("%.7f", ans);
  return 0;
}
