#include <bits/stdc++.h>
const long long N = 3 * 1e5 + 5;
const long long MOD = 1000000007;
const long long MOD2 = 998244353;
const long long inf = 1e18;
using namespace std;
void solve() {
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  long long diff[6000];
  memset(diff, 0, sizeof(diff));
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      diff[abs(a[j] - a[i])]++;
    }
  }
  long long suff[11000];
  memset(suff, 0, sizeof(suff));
  long long sum = 0;
  for (long long i = 5000; i >= 0; i--) {
    suff[i] = suff[i + 1] + diff[i + 1];
  }
  long long ans;
  for (long long i = 1; i < 5000; i++) {
    for (long long j = 1; j < 5000; j++) {
      ans += diff[i] * diff[j] * suff[i + j];
    }
  }
  long double uni = 1.0;
  double fans = (uni * ans) / (uni * n * n * n * (n - 1) * (n - 1) * (n - 1));
  printf("%.20lf", fans);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  long long t = 1;
  long long ctr = 0;
  while (t--) {
    ctr++;
    solve();
  }
  cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC
       << "ms\n";
}
