#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using vll = vector<ll>;
using vvll = vector<vll>;
using pll = pair<ll, ll>;
using vpll = vector<pll>;
using ld = long double;
using vld = vector<ld>;
void func() {
  ll n;
  cin >> n;
  vll a(n);
  for (ll i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  vld d(5000, 0.0);
  ll d_sum = (n * (n - 1)) / 2;
  for (ll i = 0; i < n; i++) {
    for (ll j = i + 1; j < n; j++) {
      d[a[j] - a[i]]++;
    }
  }
  for (ll i = 0; i < 5000; i++) {
    d[i] /= d_sum;
  }
  vld d_suffix(5000, 0.0);
  d_suffix[4999] = d[4999];
  for (ll i = 4998; i >= 0; i--) {
    d_suffix[i] = d_suffix[i + 1] + d[i];
  }
  ld ans = 0.0;
  for (ll i = 0; i < 5000; i++) {
    for (ll j = 0; j < 4999 - i; j++) {
      ans += d[i] * d[j] * d_suffix[i + j + 1];
    }
  }
  cout << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  ;
  cout.precision(32);
  ll t = 1;
  for (ll i = 1; i <= t; i++) {
    func();
  }
}
