#include <bits/stdc++.h>
using namespace std;
const int rmax = 5400;
long double ans = 0, z, x, y;
int n, a[3000], ps[6000], r[6000];
int main() {
  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 = 0; j < n; j++)
      if (i != j && a[i] - a[j] > 0) r[a[i] - a[j]]++;
  for (int i = 1; i < rmax; i++) ps[i] = ps[i - 1] + r[i];
  for (int i = 1; i < rmax; i++)
    for (int j = 1; j + i < rmax; j++) {
      x = r[i];
      y = r[j];
      z = ps[rmax - 1] - ps[i + j];
      ans += x * y * z;
    }
  ans /= n;
  ans /= n;
  ans /= n;
  ans /= n - 1;
  ans /= n - 1;
  ans /= n - 1;
  ans *= 8;
  cout << setprecision(12) << fixed << ans;
  return 0;
}
