#include <bits/stdc++.h>
using namespace std;
ifstream in("jerrys_protest.in");
ofstream out("jerrys_protest.out");
const int Nmax = 5005;
int main() {
  unsigned long long n;
  unsigned long long rez = 0;
  cin.sync_with_stdio(false);
  cin >> n;
  vector<unsigned long long> dif;
  vector<unsigned long long> v(n + 1);
  vector<unsigned long long> cnt(Nmax);
  vector<unsigned long long> maxim(Nmax);
  vector<unsigned long long> sum_part(Nmax * Nmax);
  vector<bool> OK(Nmax);
  for (unsigned long long i = 1; i <= n; i++) cin >> v[i];
  for (unsigned long long i = 1; i < n; i++)
    for (unsigned long long j = i + 1; j <= n; j++) {
      if (v[i] > v[j]) {
        unsigned long long D = v[i] - v[j];
        if (OK[D] == 0) dif.push_back(v[i] - v[j]), OK[D] = 1;
        cnt[D]++;
      } else {
        unsigned long long D = v[j] - v[i];
        if (OK[D] == 0) dif.push_back(v[j] - v[i]), OK[D] = 1;
        cnt[D]++;
      }
    }
  sort(dif.begin(), dif.end());
  for (unsigned long long i = dif.size() - 1; i >= 0; i--) {
    sum_part[i] = sum_part[i + 1] + cnt[dif[i]];
    if (i == 0) break;
  }
  for (unsigned long long i = 0; i < dif.size() - 1; i++)
    maxim[dif[i]] = sum_part[i + 1];
  for (unsigned long long i = 1; i <= 5000; i++) {
    if (i == dif[dif.size() - 1]) break;
    if (maxim[i] == 0) maxim[i] = maxim[i - 1];
  }
  for (unsigned long long i = 0; i < dif.size(); i++)
    for (unsigned long long j = 0; j < dif.size(); j++) {
      unsigned long long dif_curent = dif[i] + dif[j];
      rez = rez + maxim[dif_curent] * cnt[dif[i]] * cnt[dif[j]];
    }
  double sol;
  unsigned long long numitor =
      (((n - 1) * n) / 2) * (((n - 1) * n) / 2) * (((n - 1) * n) / 2);
  sol = double(rez) / double(numitor);
  cout << fixed << setprecision(10) << sol;
  return 0;
}
