#include <bits/stdc++.h>
using namespace std;
long long b[5005 * 10], a[5005 * 10], r, m, n, c[5005 * 10];
pair<long long, long long> p[2100005];
char g;
int main() {
  ios_base::sync_with_stdio(0);
  long long i = 0, j = 0, k = 0, t = 0, x = 0, q = 0, z = 0, y = 0, l = 0;
  cin >> n;
  for (i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  m = 0;
  for (i = 0; i < n; i++) {
    for (j = i + 1; j < n; j++) {
      if (a[i] < a[j]) m++;
      p[l].first = a[i];
      p[l].second = a[j];
      l++;
    }
  }
  for (i = 0; i < l; i++) {
    t = p[i].second - p[i].first;
    t = abs(t);
    b[t]++;
  }
  for (i = 5005; i >= 0; i--) c[i] = b[i], b[i] += b[i + 1];
  long long ans = 0;
  for (i = 5005; i > 0; i--) {
    for (j = 5005; j > 0; j--) {
      x = c[i];
      y = c[j];
      r = i + j + 1;
      if (r > 5000) continue;
      ans = ans + b[r] * x * y;
    }
  }
  double d1 = ans, d2 = m * m * m;
  d1 = d1 / d2;
  cout << setprecision(8) << d1;
  return 0;
}
