#include <bits/stdc++.h>
using namespace std;
const int MAX = 5000;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  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> ds(MAX);
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      ds[a[j] - a[i]]++;
    }
  }
  assert(ds[0] == 0);
  vector<int> prefix_ds(MAX);
  for (int d = 0; d < MAX; d++) {
    prefix_ds[d] = ds[d] + (d - 1 < 0 ? 0 : prefix_ds[d - 1]);
  }
  long long can = 0;
  long long all = 0;
  for (int d1 = 1; d1 < MAX; d1++) {
    for (int d2 = 1; d2 < MAX; d2++) {
      if (ds[d1] == 0 || ds[d2] == 0) {
        continue;
      }
      long long gt = (prefix_ds[MAX - 1] - prefix_ds[min(MAX - 1, d1 + d2)]) *
                     (ds[d1] * 1LL * ds[d2]);
      can += gt;
      all += (ds[d1] * 1LL * ds[d2]) * n * (n - 1) / 2;
    }
  }
  cout << setprecision(10) << fixed << (can * 1.0) / all << '\n';
  return 0;
}
