#include <bits/stdc++.h>
using namespace std;
const int N = 2e3 + 5, M = 5e3;
int n, a[N];
double p[M + 5], suf[M + 5];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j < i; j++) {
      p[a[i] - a[j]] += 2.0 / (1.0 * n * (n - 1));
    }
  }
  double ans = 0;
  for (int i = M; i >= 0; i--) {
    suf[i] = suf[i + 1] + p[i];
  }
  for (int i = 1; i <= 5000; i++) {
    if (!p[i]) {
      continue;
    }
    for (int j = 1; j <= 5000; j++) {
      ans += p[i] * p[j] * suf[i + j + 1];
    }
  }
  cout << fixed << setprecision(10) << ans;
}
