#include <bits/stdc++.h>
using namespace std;
long long modpow(long long a, long long b,
                 long long mod = (long long)(1e9 + 7)) {
  if (!b) return 1;
  a %= mod;
  return modpow(a * a % mod, b / 2, mod) * (b & 1 ? a : 1) % mod;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int n;
long long a[2000], p[5000], p2[5000];
long double dp() {
  for (int i = 0; i < 5000; i++) p[i] = 0, p2[i] = 0;
  long double div = 1LL * n * (n - 1) / 2;
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j <= n - 1; j++) p[a[j] - a[i]]++;
  for (int i = 0; i < 5000; i++)
    for (int j = 0; j < 5000; j++)
      if (p[i] && p[j] && i + j < 5000) p2[i + j] += p[i] * p[j];
  long long ans = 0;
  for (int i = 0; i < 5000; i++)
    for (int j = i + 1; j <= 4999; j++) ans += p[j] * p2[i];
  return long double(ans) / div / div / div;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  while (cin >> n) {
    for (int i = 0; i < n; i++) cin >> a[i];
    cout << setprecision(18) << dp() << endl;
  }
  return 0;
}
