#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;
  set<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.insert(a[j] - a[i]);
    }
  }
  for (int i = 4999; i >= 0; --i) {
    suff[i] += suff[i + 1];
  }
  long double ans = 0;
  for (auto it1 = differences.begin(); it1 != differences.end(); it1++) {
    for (auto it2 = differences.begin(); it2 != differences.end(); it2++) {
      if ((*it1 + *it2 + 1) <= 5000) {
        ans += cnt[*it1] * cnt[*it2] * suff[(*it1 + *it2 + 1)];
      }
    }
  }
  long long divide = (total) * (total) * (total);
  cout << fixed << setprecision(10) << ans / divide;
}
