#include <bits/stdc++.h>
using namespace std;
long long n;
long long a[5002];
long long d[2002];
long long suf[4002];
long double sax, lav;
int main() {
  cout.setf(ios::fixed);
  cout.precision(6);
  cin >> n;
  sax = n * (n - 1) / 2;
  sax = sax * sax * sax;
  for (long long i = 1; i <= n; ++i) cin >> a[i];
  sort(a + 1, a + n + 1);
  for (long long i = 1; i <= n; ++i)
    for (long long j = i + 1; j <= n; ++j) d[a[j] - a[i]]++;
  for (long long i = a[n] - a[1]; i >= 0; --i) suf[i] = suf[i + 1] + d[i];
  for (long long i = 0; i <= a[n] - a[1]; ++i)
    for (long long j = 0; j <= a[n] - a[1]; ++j)
      lav += d[i] * d[j] * suf[i + j + 1];
  cout << lav / sax << endl;
  return 0;
}
