#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  long long a[n], cnt[5001] = {0}, suff[5001] = {0};
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  long long total = 0;
  vector<long long> differences;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      total++;
      cnt[a[j] - a[i]]++;
      suff[a[j] - a[i]]++;
      differences.push_back(a[j] - a[i]);
    }
  }
  for (int i = 4999; i >= 0; --i) {
    suff[i + 1] += suff[i];
  }
  long double ans = 0;
  for (int i = 0; i < differences.size(); i++) {
    for (int j = 0; j < differences.size(); j++) {
      if ((differences[i] + differences[j] + 1) <= 5000)
        ans += suff[(differences[i] + differences[j] + 1)];
    }
  }
  long long divide = (total) * (total) * (total);
  cout << fixed << setprecision(10) << ans / divide;
}
