#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];
  }
  vector<int> d(5000, 0);
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      ++d[abs(a[i] - a[j])];
    }
  }
  vector<int> c(5000);
  c[4999] = 0;
  for (int i = 4998; i >= 0; --i) {
    c[i] = c[i + 1] + d[i + 1];
  }
  long long good = 0;
  for (int d1 = 1; d1 < 5000; ++d1) {
    for (int d2 = 1; d2 < 5000 - d1; ++d2) {
      good += static_cast<long long>(d[d1]) * d[d2] * c[d1 + d2];
    }
  }
  long long all = n * (n - 1) / 2;
  all = all * all * all;
  cout.precision(10);
  cout << fixed
       << static_cast<long double>(good) / static_cast<long double>(all);
  return 0;
}
