#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream &operator<<(ostream &cout, vector<T> &a) {
  for (size_t i = 0; i < a.size(); ++i) cout << a[i] << " ";
  return cout;
}
template <typename T>
ostream &operator<<(ostream &cout, vector<vector<T> > &a) {
  for (size_t i = 0; i < a.size(); ++i) cout << a[i] << endl;
  return cout;
}
int a[2000];
int x[4999];
int allP[5000];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  map<int, int> d;
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      ++d[abs(a[i] - a[j])];
    }
  }
  int c = 0;
  for (auto i : d) {
    x[c++] = i.first;
    allP[c] = allP[c - 1] + i.second;
  }
  unsigned long long ans = 0;
  auto k = upper_bound(x, x + c, 0);
  for (auto i : d) {
    for (auto j : d) {
      k = upper_bound(x, x + c, i.first + j.first);
      ans += allP[c - 1] - allP[k - x - 1];
    }
  }
  n = n * (n - 1) / 2;
  cout << double(ans) / n / n / n << endl;
  return 0;
}
