#include <bits/stdc++.h>
using namespace std;
int N, ip[5005];
long long sum[10005];
map<int, int> mp;
vector<pair<int, 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]);
      mp[v]++;
    }
  }
  for (auto it : mp) vec.push_back(it);
  sort(begin(vec), end(vec));
  int sz = ((int)((vec).size()));
  sum[sz] = 0;
  for (int i = sz - 1; i >= 0; i--) sum[i] = sum[i + 1] + vec[i].second;
  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].first + vec[j].first >= vec[k].first) k++;
      if (k >= sz) break;
      res += 1LL * vec[i].second * vec[j].second * sum[k];
    }
  }
  double ans = 1.0 * res / sum[0] / sum[0] / sum[0];
  cout << fixed << setprecision(10) << ans << endl;
  return 0;
}
