#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
struct Sync_stdio {
  Sync_stdio() {
    cin.tie(NULL);
    ios_base::sync_with_stdio(false);
  }
} _sync_stdio;
int main() {
  int n;
  cin >> n;
  vector<long long> a(n);
  for (int __i = 0; __i < (n); ++__i) cin >> a[__i];
  ;
  vector<long long> v;
  for (int i = (0); i < (n); ++i) {
    for (int j = (0); j < (n); ++j) {
      if (i == j) {
        continue;
      }
      if (a[i] <= a[j]) {
        continue;
      }
      v.push_back(a[i] - a[j]);
    }
  }
  vector<long long> b(5002);
  for (int i = (0); i < (v.size()); ++i) {
    ++b[v[i]];
  }
  vector<long long> c(10010);
  for (int i = (0); i < (b.size()); ++i) {
    for (int j = (0); j < (b.size()); ++j) {
      c[i + j] += b[i] * b[j];
    }
  }
  vector<long long> ps = c;
  for (int i = (1); i < (ps.size()); ++i) {
    ps[i] += ps[i - 1];
  }
  long double res = 0;
  for (int i = (0); i < (v.size()); ++i) {
    res += ps[v[i] - 1] * 1.0 / v.size() / ps.back();
  }
  cout << fixed << setprecision(10) << res << "\n";
}
