#include <bits/stdc++.h>
using namespace std;
const int maxn = 2000 + 100;
const int maxd = 5010;
long long dif[maxd];
int n;
int a[maxn];
long long ans = 0;
long long sumd[maxd];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++) dif[abs(a[i] - a[j])]++;
  long long sum = 0;
  for (int i = 1; i < maxd - 2; i++) sumd[i] = sumd[i - 1] + dif[i];
  for (int i = 1; i < maxd - 2; i++) {
    for (int j = 1; j < maxd - 2 && i + j <= maxd - 4; j++) {
      sum += dif[i] * dif[j] * (sumd[maxd - 3] - sumd[i + j]);
    }
  }
  long long maxi = sumd[maxd - 3] * sumd[maxd - 3] * sumd[maxd - 3];
  long long md = 10000000;
  sum *= md;
  ans = sum / maxi;
  cout << ans / md << ".";
  if (ans == 0)
    cout << 0 << endl;
  else {
    while (ans * 10 < md) {
      cout << "0";
      ans *= 10;
    }
    cout << ans % md << endl;
  }
}
