#include <bits/stdc++.h>
using namespace std;
const int maxn = 300005;
const int logn = 20;
const int inf = (int)1e9;
const long long mod = (int)1e9 + 7;
const long long l_inf = (long long)4e18;
int n;
int a[maxn];
long long dif[maxn], cnt[maxn];
long long p = 0;
long double f() {
  int x = n * (n - 1) / 2;
  return 1ll * x * x * x;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.precision(15);
  cout << fixed;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++) dif[a[j] - a[i]]++;
  for (int i = 0; i <= 5000; i++)
    for (int j = 0; j <= 5000; j++) cnt[i + j] += dif[i] * 1ll * dif[j];
  for (int i = 0; i <= 5000; i++) {
    if (cnt[i] == 0) continue;
    int l = 0, r = 0;
    while (r < n) {
      while (a[r] - a[l] > i) l++;
      p += l * 1ll * cnt[i];
      r++;
    }
  }
  cout << ((long double)(p)) / f();
  return 0;
}
