#include <bits/stdc++.h>
using namespace std;
int cntl[5009];
int psum[5009];
long long cnt[5009];
const int maxl = 5000;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  for (int i = 0; i < n; ++i)
    for (int j = i + 1; j < n; ++j) cntl[abs(a[i] - a[j])]++;
  psum[0] = 0;
  for (int i = 1; i <= maxl; ++i) psum[i] = psum[i - 1] + cntl[i];
  for (int i = 1; i <= maxl; ++i) {
    for (int i1 = 1; i1 < maxl; ++i1) {
      int i2 = i - i1;
      cnt[i] += psum[i2] * cntl[i1];
    }
  }
  long double ans = 0;
  for (int i = 2; i <= maxl; ++i) ans += (long double)cnt[i - 1] * cntl[i];
  ans *= 8;
  ans /= (n * (n - 1));
  ans /= (n * (n - 1));
  ans /= (n * (n - 1));
  printf("%.10Lf\n", ans);
}
