#include <bits/stdc++.h>
using namespace std;
int N, ip[5005];
set<int> s;
vector<int> vec;
int main(int argc, char **argv) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  cin >> N;
  for (int i = 0; i < (N); i++) {
    cin >> ip[i];
    for (int j = 0; j < (i); j++) {
      int v = abs(ip[i] - ip[j]);
      if (s.count(v)) continue;
      s.insert(v);
      vec.push_back(v);
    }
  }
  sort(begin(vec), end(vec));
  int sz = ((int)((vec).size()));
  long long res = 0;
  for (int i = 0; i < (sz); i++) {
    for (int j = 0, k = 0; j < sz; j++) {
      while (k < sz && vec[i] + vec[j] >= vec[k]) k++;
      if (vec[i] + vec[j] >= vec[k]) break;
      res += sz - k;
    }
  }
  int x = N * (N - 1) / 2;
  double ans = 1.0 * res / x / x / x;
  cout << fixed << setprecision(10) << ans << endl;
  return 0;
}
