#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1000000007;
const long long int inf = (long long int)1e15;
const int N = 2111;
long long int n;
long long int a[N], diff1[5111], diff2[5111], ps[5111];
void solve() {
  memset(diff1, 0, 5111);
  memset(diff2, 0, 5111);
  memset(ps, 0, 5111);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (i == j) continue;
      if (a[i] > a[j])
        diff1[a[i] - a[j]]++;
      else
        diff2[a[j] - a[i]]++;
    }
  }
  for (int i = 1; i <= 5000; i++) {
    ps[i] = ps[i - 1] + diff2[i];
  }
  long long int num = 0, den = pow((n * (n - 1)) / 2, 3);
  for (int i = 1; i <= 5000; i++) {
    for (int j = 1; j <= 5000; j++) {
      if (i + j <= 5000 && diff1[i] && diff1[j])
        num += (ps[5000] - ps[i + j]) * (diff1[i] * diff1[j]);
    }
  }
  long double ans = (num * 1.0) / den;
  cout << fixed << setprecision(9) << ans << "\n";
  ;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int t = 1, num = 1;
  while (t--) {
    solve();
    ;
  }
  return 0;
}
