#include <bits/stdc++.h>
using namespace std;
int bal[2000 + 5], n, all, tot[5000 + 5], ftot[5000 * 2 + 5];
int main() {
  scanf("%d", &n);
  all = n * (n - 1) / 2;
  all = pow(all * 1.0, 3.0);
  for (int i = 0; i < n; i++) scanf("%d", &bal[i]);
  sort(bal, bal + n);
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++) tot[bal[j] - bal[i]]++;
  for (int i = 0; i <= 5000; i++)
    for (int j = 0; j <= 5000; j++) ftot[i + j] += tot[i] * tot[j];
  int ans = 0;
  for (int i = 0; i <= 5000; i++)
    for (int j = 0; j < i; j++) ans += tot[i] * ftot[j];
  printf("%.10lf", (double)ans / all);
  return 0;
}
