#include <bits/stdc++.h>
using namespace std;
const long long N = 5e3 + 5;
long long cnt[N + 5];
long long ps[N + 5];
long long a[N];
long long n;
int main() {
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long m = 0;
  for (long long i = 0; i < n; i++) {
    for (long long j = i + 1; j < n; j++) {
      cnt[abs(a[i] - a[j])]++;
      m++;
    }
  }
  ps[0] = 0;
  for (long long i = 1; i <= N; i++) {
    ps[i] = ps[i - 1] + cnt[i];
  }
  long long ans = 0;
  for (long long i = 1; i <= N; i++) {
    for (long long j = 1; j <= N; j++) {
      if (i + j > N) {
        continue;
      }
      ans += cnt[i] * cnt[j] * (ps[N] - ps[i + j]);
    }
  }
  cout << std::setprecision(9) << (double)ans / (m * m * m) << endl;
}
