#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5005;
int a[MAXN];
map<int, long long> neg;
vector<int> pos;
long long neg_sz = 0;
map<int, long long> convolute(map<int, long long>& mapa) {
  map<int, long long> ans;
  for (auto it : mapa) {
    for (auto it2 : mapa) {
      ans[it.first + it2.first] += 1LL * it.second * it2.second;
      neg_sz += 1LL * it.second * it2.second;
    }
  }
  return ans;
}
int main(void) {
  int n;
  scanf(" %d", &n);
  for (int i = 0; i < n; i++) {
    scanf(" %d", &a[i]);
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (i == j) continue;
      int diff = a[i] - a[j];
      if (diff < 0) {
        neg[diff]++;
      } else {
        pos.push_back(diff);
      }
    }
  }
  sort(pos.begin(), pos.end());
  int good = (int)pos.size();
  int small_good_idx = 0;
  neg = convolute(neg);
  double ans = 0;
  for (auto it = neg.rbegin(); it != neg.rend(); it++) {
    auto it_neg = *it;
    while (small_good_idx < (int)pos.size() &&
           pos[small_good_idx] + it_neg.first <= 0) {
      good--;
      small_good_idx++;
    }
    ans += 1.0 * it_neg.second * good;
  }
  printf("%.12f\n", ans / (neg_sz * pos.size()));
  return 0;
}
