#include <bits/stdc++.h>
using namespace std;
int a[2000];
long long q[10013];
long long suf[10011];
auto prob = q + 5005;
auto suff = suf + 5005;
long long getsum(int i, int j) {
  if (i > j) return 0LL;
  return suff[j] - suff[i - 1];
}
int main() {
  ::ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      if (i == j) continue;
      prob[a[j] - a[i]]++;
    }
  long long total = 0;
  for (int i = -5000; i <= 5000; i++) suff[i] = prob[i] + suff[i - 1];
  long long ans = 0;
  for (int i = -1; i >= -5000; i--)
    for (int j = -1; j >= -5000; j--) {
      ans += prob[j] * prob[i] * getsum(-i - j + 1, 5000);
      total += prob[i] * prob[j] * getsum(1, 5000);
    }
  cout.precision(20);
  cout << (long double)(ans) / total;
  return 0;
}
