#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  vector<int> a(n);
  for (auto i = a.begin(); i != a.end(); ++i) scanf("%d", i);
  sort(a.begin(), a.end());
  vector<int> d(5000);
  for (auto i = a.begin(); i != a.end(); ++i)
    for (auto j = a.begin(); j != i; ++j) ++d[*i - *j];
  vector<int> s(d);
  for (auto pr = s.rbegin(), nx = ++s.rbegin(); nx != s.rend(); ++nx, ++pr)
    *nx += *pr;
  s.resize(2 * s.size());
  vector<size_t> p;
  for (size_t i = 0; i < d.size(); ++i)
    if (d[i]) p.push_back(i);
  long long c{};
  for (auto i = p.begin(); i != p.end(); ++i)
    for (auto j = p.begin(); j <= i; ++j)
      c += d[*i] * d[*j] * 2ll * (s[*i + *j + 1]);
  printf("%.6f", c / pow<double, int>(n * (n - 1) / 2, 3));
}
