#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e6 + 123;
const long long INF = (long long)1e18 + 123;
const int inf = (int)1e9 + 123;
const double eps = 1e-6;
inline void boost() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
}
int n, a[2111];
int cnt[6011], cnt1[6011];
double ans, tot_val;
int main() {
  boost();
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j < i; j++) {
      cnt[a[i] - a[j]]++;
      cnt1[a[i] - a[j]]++;
    }
  }
  for (int i = 5000; i >= 0; i--) {
    cnt[i] += cnt[i + 1];
  }
  for (int i = 0; i <= 5000; i++) {
    for (int j = 0; j <= 5000; j++) {
      int summ = i + j;
      if (summ <= 5000) {
        ans += 1.0 * cnt1[i] * cnt1[j] * cnt[summ + 1];
      }
    }
  }
  double tot_val = n * (n - 1) / 2;
  tot_val = tot_val * tot_val * tot_val;
  cout << fixed << setprecision(6) << ans / tot_val;
  return 0;
}
