#include <bits/stdc++.h>
using namespace std;
const int N = 2002;
const int max_a_i = 5000;
int main() {
  int n, a[N];
  int two_rounds[max_a_i + 1], cnt[max_a_i + 1], win[max_a_i + 1];
  memset(cnt, 0, sizeof cnt);
  memset(two_rounds, 0, sizeof two_rounds);
  memset(win, 0, sizeof win);
  int pro = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < i; j++) {
      cnt[a[i] - a[j]]++;
    }
  }
  for (int i = 0; i <= max_a_i; i++) {
    for (int j = 0; j + i <= max_a_i; j++) two_rounds[i + j] += cnt[i] * cnt[j];
  }
  for (int i = 0; i <= max_a_i; i++) win[i] = two_rounds[i];
  for (int i = 1; i <= max_a_i; i++) {
    win[i] += win[i - 1];
    pro += win[i - 1] * cnt[i];
  }
  double ans = (0.0 + pro * 8) / n / n / n / (n + 1) / (n + 1) / (n + 1);
  printf("%.10f", ans);
}
