#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
const double E = 2.718281828459;
const int INF = 1e9;
const long long MOD = 1e9 + 7;
const int MAXN = 1e6 + 3;
int aa[6000];
long long cant[6000];
long long tmp[6000];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  long long n;
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> aa[i];
  sort(aa, aa + n);
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) tmp[aa[j] - aa[i]]++;
  }
  cant[5999] = tmp[5999];
  for (int i = 5998; i >= 0; --i) cant[i] = cant[i + 1] + tmp[i];
  long double ans = 0;
  for (int i = 0; i < 6000; ++i) {
    if (!tmp[i]) continue;
    for (int j = 0; j < 6000; ++j) {
      if (!tmp[j]) continue;
      if (i + j >= 6000) continue;
      ans += long double(cant[i + j + 1]) * long double(tmp[i]) *
             long double(tmp[j]);
    }
  }
  long double tt = (long double(n) * (n - 1.0) / 2);
  long double dem = tt * tt * tt;
  long double ret = ans * 1.0 / dem;
  double rt = double(ret);
  printf("%.10lf\n", rt);
  return 0;
}
