#include <bits/stdc++.h>
using namespace std;
int a[2005], cnt1[5005];
long long cnt[10005], suf[5005];
int main() {
  int n;
  scanf("%d", &n);
  int i, j;
  for (i = 1; i <= n; i++) scanf("%d", &a[i]);
  sort(a + 1, a + n + 1);
  for (i = 1; i <= n; i++) {
    for (j = i + 1; j <= n; j++) {
      cnt1[a[j] - a[i]]++;
    }
  }
  for (i = 1; i <= 5000; i++) {
    for (j = 1; j <= 5000; j++) {
      cnt[i + j] += (long long)cnt1[i] * cnt1[j];
    }
  }
  long long ans = 0;
  long long add = 0;
  for (i = 2; i <= 5000; i++) {
    ans += cnt1[i] * add;
    add += cnt[i];
  }
  long long game = n * (n - 1) / 2;
  game = game * game * game;
  double final = (double)ans / game;
  cout.precision(8);
  cout << fixed << final;
}
