#include <bits/stdc++.h>
using namespace std;
int A[5010], pres[5010], pref[5010], suf[5010], diff[5010], ans[5010];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> A[i];
    pres[A[i]] = 1;
    suf[A[i]] = 1;
    pref[A[i]] = 1;
  }
  for (int i = 0; i <= 5000; i++) {
    for (int j = i; j <= 5000; j++) {
      if (pres[i] && pres[j]) {
        diff[j - i]++;
      }
    }
  }
  for (int i = 5000; i >= 0; i--) suf[i] += suf[i + 1];
  for (int i = 1; i <= 5000; i++) pref[i] += pref[i - 1];
  for (int i = 0; i <= 5000; i++) {
    for (int j = 0; j <= 5000; j++) {
      if (pres[j] && j + i <= 5000) {
        ans[i] += suf[j + i];
      }
    }
  }
  double tot_count = 1.0 * n * (n - 1) / 2;
  double res = 0;
  for (int i = 1; i <= 5000; i++) {
    for (int j = 1; j <= 5000; j++) {
      if (i + j + 1 <= 5000 && diff[i] && diff[j] && ans[i + j + 1]) {
        res += (diff[i] / tot_count) * (diff[j] / tot_count) *
               (ans[i + j + 1] / tot_count);
      }
    }
  }
  cout << res << '\n';
}
