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