#include <bits/stdc++.h>
using namespace std;
int n, a[10000];
double s[10000], sum[10000];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i < n; i++)
    for (int j = i + 1; j <= n; j++) s[abs(a[i] - a[j])]++;
  for (int i = 1; i <= 4999; i++) sum[i] = sum[i - 1] + s[i];
  double ans = 0;
  for (int i = 1; i <= 4999; i++)
    for (int j = 1; j <= 4999; j++)
      if (i + j < 5000) ans = ans + s[i] * s[j] * (sum[4999] - sum[i + j]);
  ans = ans / (n * (n - 1) / 2);
  ans = ans / (n * (n - 1) / 2);
  ans = ans / (n * (n - 1) / 2);
  printf("%.6lf", ans);
  return 0;
}
