#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < int(n); i++) cin >> v[i];
  sort(v.begin(), v.end());
  int s = v[n - 1] - v[0] + 1;
  vector<long long int> dif(v[n - 1] - v[0] + 1, 0);
  for (int i = 0; i < int(n); i++) {
    for (int j = i + 1; j < n; ++j) {
      dif[v[j] - v[i]]++;
    }
  }
  int sz = dif.size();
  vector<long long int> vi(sz, 0);
  vi[sz - 1] = dif[sz - 1];
  for (int i = sz - 2; i >= 0; --i) {
    vi[i] = vi[i + 1] + dif[i];
  }
  double res = 0;
  for (int i = 0; i < int(sz); i++) {
    for (int j = i; j < sz; ++j) {
      long long int l = 0;
      if (i + j + 1 >= sz) continue;
      l = dif[i] * dif[j] * vi[i + j + 1];
      res += (double)(l) /
             (double)(n * (n - 1) / 2 * n * (n - 1) / 2 * n * (n - 1) / 2);
    }
  }
  cout.precision(17);
  cout << res << endl;
}
int main() {
  cin.sync_with_stdio(false);
  cout.sync_with_stdio(false);
  solve();
}
