#include <bits/stdc++.h>
using namespace std;
int num[5010];
map<int, int> mp, mpp;
map<int, int>::iterator it, itt;
void calc() {
  int t = 0;
  it = mp.end();
  it--;
  for (;; it--) {
    t += it->second;
    mpp[it->first] = t;
    if (it == mp.begin()) break;
  }
}
int getsuf(int x) { return mpp.upper_bound(x)->second; }
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &num[i]);
  sort(num + 1, num + 1 + n);
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++) mp[num[j] - num[i]]++;
  calc();
  double ans = 0;
  int tot = mp.size();
  for (it = mp.begin(); it != mp.end(); it++)
    for (itt = mp.begin(); itt != mp.end(); itt++) {
      int ttt = getsuf(it->first + itt->first);
      ans += it->second * 1.0 / tot * itt->second * 1.0 / tot *
             getsuf(it->first + itt->first) * 1.0 / tot;
    }
  printf("%.14f\n", ans);
  return 0;
}
