#include <bits/stdc++.h>
using namespace std;
int n, a[2005];
long long ans, t, cnt1[5005], cnt2[5005];
vector<int> b;
int main() {
  int i, j;
  cin >> n;
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  sort(a, a + n);
  for (i = 0; i < n; i++) {
    for (j = 0; j < i; j++) {
      cnt1[a[i] - a[j]]++;
      if (cnt1[a[i] - a[j]] == 1) b.push_back(a[i] - a[j]);
    }
  }
  sort(b.begin(), b.end());
  for (i = 0; i < b.size(); i++) {
    for (j = i; j < b.size(); j++) {
      if (b[i] + b[j] >= 5000) break;
      cnt2[b[i] + b[j]] += cnt1[b[i]] * cnt1[b[j]];
    }
  }
  for (i = 1; i < 5000; i++) {
    cnt2[i] += cnt2[i - 1];
  }
  for (i = 0; i < b.size(); i++) {
    ans += cnt1[b[i]] * cnt2[a[i] - 1];
  }
  t = n * (n - 1) / 2;
  printf("%.7f", (double)ans / (t * t * t));
  return 0;
}
