#include <bits/stdc++.h>
using namespace std;
long long n, a[2004];
double r, res;
double f[5005], s[5005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie();
  ;
  cin >> n;
  for (long long i = 0; i <= n - 1; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  for (long long i = 0; i <= n - 1; i++) {
    for (long long j = 0; j <= i - 1; j++) {
      r++;
      f[a[i] - a[j]] += 1;
    }
  }
  for (int i = 5000; i >= 0; i--) {
    f[i] /= r;
    s[i] = s[i + 1] + f[i];
  }
  for (long long i = 1; i <= 5000 - 1; i++) {
    for (long long j = 1; j <= 5000 - i - 1; j++) {
      res = res + (s[i + j + 1] * f[i] * f[j]);
    }
  }
  cout.precision(10);
  cout << fixed << res;
  return 0;
}
