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