#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:167777216")
using namespace std;
const long long Mll = 1000000000000000000;
const long long Mint = 1000001000;
const long long mod = 1000000007;
long long f[10100], a[10100], fl[10100], s[10100];
int n;
int main() {
  srand(time(NULL));
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(10);
  long long n;
  cin >> n;
  for (int i(0); i < n; i++) cin >> a[i];
  if (n == 2) {
    cout << 0;
    return 0;
  }
  for (int i(0); i < n; i++)
    for (int j(i + 1); j < n; j++) f[abs(a[i] - a[j])]++;
  long long nm = 5005;
  for (int i(0); i < nm; i++) {
    if (f[i] == 0) continue;
    for (int j(i); j < nm; j++) {
      if (f[j] == 0) continue;
      long long x = f[i] * f[j];
      fl[i + j] += x;
    }
  }
  s[nm] = 0;
  for (int i(nm - 1); i >= 0; i--) s[i] = f[i] + s[i + 1];
  long long k = (n * (n - 1)) / 2;
  long double ans = 0;
  for (int i(0); i < nm; i++) {
    long long y = fl[i];
    if (y == 0) continue;
    long long x = s[i + 1];
    long double ver = (y + .0) / (k * k + .0);
    ver = ver * (x + .0) / (k + .0);
    ans += ver;
  }
  cout << fixed << ans;
}
