#include <bits/stdc++.h>
using namespace std;
int n, a[2010];
int t[5010];
int t2[5010];
vector<int> s;
vector<pair<int, long long> > tmp;
vector<long long> x;
int main(int argc, char **argv) {
  scanf("%d", &n);
  int sum = 0;
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
    sum += a[i];
  }
  sort(a, a + n);
  for (int i = n - 1; i >= 0; --i) {
    for (int j = i - 1; j >= 0; --j) ++t[a[i] - a[j]] = 1;
  }
  vector<int> v;
  for (int i = 0; i <= 5000; ++i) {
    if (t[i]) {
      v.push_back(i);
    }
  }
  for (int i = 0; i < (int)v.size(); ++i) {
    for (int j = 0; j < (int)v.size(); ++j) {
      s.push_back(v[i] + v[j]);
      x.push_back((long long)t[v[i]] * t[v[j]]);
      tmp.push_back(make_pair(s.back(), x.back()));
    }
  }
  sort(tmp.begin(), tmp.end());
  for (int i = 0; i < (int)tmp.size(); ++i) {
    s[i] = tmp[i].first;
    x[i] = tmp[i].second;
    if (i) x[i] += x[i - 1];
  }
  long long d = n * n * n;
  long long ans = 0;
  for (int i = 0; i < (int)v.size(); ++i) {
    int idx = lower_bound(s.begin(), s.end(), v[i]) - s.begin();
    --idx;
    if (idx < 0) continue;
    ans += x[idx];
  }
  printf("%.15lf\n", (double)ans / d);
  return 0;
}
