#include <bits/stdc++.h>
using namespace std;
const int offset = 5000;
int sav[5005], n, a[2005];
vector<double> v;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  double ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (i == j) continue;
      if (a[i] <= a[j]) continue;
      sav[a[i] - a[j]]++;
      v.push_back(a[i] - a[j]);
    }
  }
  sort(v.begin(), v.end());
  for (int i = 1; i <= 5000; i++) {
    for (int j = 1; j <= 5000 && i + j < v.back(); j++) {
      if (!sav[i] || !sav[j]) continue;
      int lo = 0, hi = v.size() - 1;
      while (lo < hi) {
        int md = lo + (hi - lo) / 2;
        if (v[md] > i + j)
          hi = md;
        else
          lo = md + 1;
      }
      if (v[lo] <= i + j) continue;
      double rem = v.size() - lo;
      ans = (ans + (rem * (double)sav[i] * sav[j]));
    }
  }
  double tmp = n * (n - 1) / 2;
  cout << fixed << setprecision(6) << (double)ans / (tmp * tmp * tmp) << '\n';
}
