#include <bits/stdc++.h>
const long long mod = 998244353;
using namespace std;
const long long N = 2005;
long long n, a[N], cnt[5005], suf[5005];
vector<long long> v;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + 1 + n);
  long double ans = 0.00;
  for (long long i = 1; i <= n; i++) {
    for (long long j = i + 1; j <= n; j++) {
      cnt[a[j] - a[i]]++;
    }
  }
  for (long long dif = 5000; dif >= 0; dif--) {
    suf[dif] = suf[dif + 1] + cnt[dif];
  }
  long double x = (n * (n - 1)) / 2.0;
  long long done = 0;
  for (long long i = 0; i <= 5000; i++) {
    for (long long j = 0; j < 5000; j++) {
      if (i + j >= 5000) continue;
      ans += cnt[i] * cnt[j] * suf[i + j + 1];
    }
  }
  ans /= x;
  ans /= x;
  ans /= x;
  cout << setprecision(25) << fixed << ans << '\n';
  return 0;
}
