#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n, 0);
  for (int i = 0 - (0 > n); i != n - (0 > n); i += 1 - 2 * (0 > n)) cin >> a[i];
  sort((a).begin(), (a).end());
  vector<int> d(5005, 0);
  for (int i = 1 - (1 > n); i != n - (1 > n); i += 1 - 2 * (1 > n)) {
    for (int j = 0 - (0 > i); j != i - (0 > i); j += 1 - 2 * (0 > i)) {
      d[a[i] - a[j]]++;
    }
  }
  vector<int> s(5005, 0);
  s = d;
  double p = (2.0 / (n * 1.0 * (n - 1)));
  double ans = 0;
  for (int i = 1 - (1 > 5005); i != 5005 - (1 > 5005); i += 1 - 2 * (1 > 5005))
    s[i] += s[i - 1];
  for (int i = 0 - (0 > 5005); i != 5005 - (0 > 5005);
       i += 1 - 2 * (0 > 5005)) {
    for (int j = 0 - (0 > 5005); j != 5005 - (0 > 5005);
         j += 1 - 2 * (0 > 5005)) {
      if (i + j < 5005) {
        ans += d[i] * d[j] * p * p * (s.back() - s[i + j]) * p;
      }
    }
  }
  cout << setprecision(15) << ans << "\n";
  return 0;
}
