#include <bits/stdc++.h>
using namespace std;
int p[2222];
vector<int> v;
vector<int> a;
vector<int> s;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> p[i];
  }
  sort(p, p + n);
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) v.push_back(p[j] - p[i]);
  }
  sort(v.begin(), v.end());
  int i = 0;
  while (i < v.size()) {
    int l = i;
    while (i < v.size() && v[i] == v[l]) i++;
    a.push_back(v[l]);
    s.push_back(i);
  }
  long long ans = 0;
  for (int i = 1; i < a.size(); i++) {
    int r = i - 1;
    for (int l = 0; l < i; l++) {
      while (r >= 0 && a[l] + a[r] >= a[i]) {
        r--;
      }
      if (r == -1) break;
      if (l == 0) {
        ans += (long long)s[l] * s[r];
      } else {
        ans += (long long)(s[l] - s[l - 1]) * s[r];
      }
    }
  }
  cout << setprecision(10)
       << (((double)ans) / ((long long)v.size() * v.size() * v.size()));
  return 0;
}
