#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a.begin(), a.end());
  vector<int> cnt(5000);
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      cnt[a[j] - a[i]] += 1;
    }
  }
  vector<int> sum(5000);
  for (int i = 1; i < cnt.size(); i++) {
    sum[i] = sum[i - 1] + cnt[i];
  }
  double ans = 0.0;
  int cnt1 = 0;
  for (int i = 0; i < cnt.size(); i++) {
    if (cnt[i] == 0) continue;
    for (int j = 0; j < cnt.size(); j++) {
      if (cnt[j] == 0) continue;
      if (i - j >= 0) {
        ans += cnt[i] * cnt[j] * cnt[i - j];
      }
    }
  }
  for (int i = 0; i < 3; i++) ans /= (double)(n * (n - 1) / 2);
  printf("%.10lf\n", ans);
  return 0;
}
