#include <bits/stdc++.h>
using namespace std;
int n;
int a[2222];
unsigned long long cnt[11000], cnt2[11000], sum[11000];
unsigned long long ans;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) cnt[abs(a[i] - a[j])]++;
  }
  for (int i = 0; i <= 5000; i++)
    for (int j = 0; j <= 5000; j++) cnt2[i + j] += cnt[i] * cnt[j];
  sum[10000] = 0;
  for (int i = 9999; i >= 0; i--) sum[i] = sum[i + 1] + cnt[i];
  double ans = 0;
  double m = n * (n - 1) / 2;
  for (int i = 0; i <= 10000; i++)
    ans += (1. * (unsigned long long)cnt2[i] * sum[i + 1]) / m / m / m;
  printf("%.14lf", ans);
  return 0;
}
