#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:100000000")
using namespace std;
int n;
int a[2005];
int p[5005];
double res;
int main() {
  cin >> 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++) p[abs(a[i] - a[j])] += 2;
  for (int i = 1; i < 5005; i++) p[i] += p[i - 1];
  for (int i = 1; i < 5005; i++)
    for (int j = 1; i + j < 5005; j++) {
      res += (p[i] - p[i - 1] + 0.0) / n / (n - 1) * (p[j] - p[j - 1] + 0.0) /
             n / (n - 1) * (p[5004] - p[i + j] + 0.0) / n / (n - 1);
    }
  printf("%.10lf\n", res);
  return 0;
}
