#include <bits/stdc++.h>
using namespace std;
double b[5005] = {0}, s[5005] = {0};
int a[2005];
int main() {
  int n;
  double ans = 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++) b[a[i] - a[j]]++;
  int r = n * (n - 1) / 2;
  for (int i = 5000; i >= 0; i--) {
    b[i] /= r;
    s[i] = s[i + 1] + b[i];
  }
  for (int i = 1; i < 5000; i++)
    for (int j = 1; j + i < 5000; j++) ans += b[i] * b[j] * s[i + j + 1];
  printf("%.10lf", ans);
  return 0;
}
