#include <bits/stdc++.h>
using namespace std;
const long long N = 2000, S = 5001;
long long a[N], diff[S], prob[S];
signed main() {
  long long n;
  cin >> n;
  for (long long i = 0; i < n; ++i) cin >> a[i];
  sort(a, a + n);
  for (long long i = 0; i < n; ++i) {
    for (long long j = i + 1; j < n; ++j) {
      ++diff[a[j] - a[i]];
    }
  }
  for (long long i = 0; i < S; ++i) {
    for (long long j = 0; j < S; ++j) {
      if (i + j < S) prob[i + j] += diff[i] * diff[j];
    }
  }
  double x = 0;
  for (long long i = 0; i < S; ++i) {
    for (long long j = i + 1; j < S; ++j) {
      x += prob[i] * diff[j];
    }
  }
  cout << setprecision(10) << x / n / n / n;
}
