#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1e-9;
const int INF = 1E9;
const int MAXN = 5010;
int n;
int a[MAXN];
int cnt[MAXN];
long long pref[MAXN];
long long ans, cur;
double res;
int main() {
  cin >> n;
  for (int i = 0; i < (int)(n); i++) cin >> a[i];
  sort(a, a + n);
  for (int i = 0; i < (int)(n); i++)
    for (int j = i + 1; j < n; j++) cnt[a[j] - a[i]]++;
  ans = 0;
  for (int c = 2; c < MAXN; c++) {
    for (int i = 1; i < c; i++) pref[i] += cnt[c - 1 - i];
    cur = 0;
    for (int i = 1; i < c; i++) cur += cnt[i] * pref[i];
    cur *= cnt[c];
    ans += cur;
  }
  res = ans;
  for (int i = 0; i < (int)(3); i++) res /= 1.0 * n * (n - 1) / 2;
  cout.precision(30);
  cout << res << '\n';
  return 0;
}
