#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  map<long long, long long> cnt;
  vector<long long> data(n);
  for (int i = 0; i < n; ++i) {
    cin >> data[i];
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (i != j) {
        cnt[data[i] - data[j]]++;
      }
    }
  }
  vector<long long> ok;
  vector<long long> dp;
  int pos_start = -1;
  int count = 0;
  for (auto i : cnt) {
    ok.push_back(i.first);
    if (pos_start == -1 and i.first > 0) {
      pos_start = count;
    }
    count++;
    if (dp.size() == 0) {
      dp.push_back(i.second);
    } else {
      dp.push_back(dp.back() + i.second);
    }
  }
  double ans = 0.0;
  int sz = ok.size();
  double check = n * (n - 1) * (1.0) / (2.0);
  for (int i = pos_start; i < sz; ++i) {
    for (int j = i + 1; j < sz; ++j) {
      long long su = -(ok[i] + ok[j]);
      auto get = lower_bound(ok.begin(), ok.end(), su) - ok.begin();
      if (get > 0) {
        double tp = 1.0;
        tp *= cnt[ok[i]];
        tp *= cnt[ok[j]];
        tp *= dp[get - 1];
        ans += tp;
      }
    }
  }
  ans *= 2;
  for (int i = pos_start; i < sz; ++i) {
    long long su = -(ok[i] + ok[i]);
    auto get = lower_bound(ok.begin(), ok.end(), su) - ok.begin();
    if (get > 0) {
      double tp = 1.0;
      tp *= cnt[ok[i]];
      tp *= cnt[ok[i]];
      tp *= dp[get - 1];
      ans += tp;
    }
  }
  ans /= check;
  ans /= check;
  ans /= check;
  cout.precision(10);
  cout << fixed << ans << "\n";
  return 0;
}
