#include <bits/stdc++.h>
using namespace std;
int a[2003];
double f[5005], res;
int n;
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 = 1; j < i; ++j) ++f[abs(a[i] - a[j])];
  for (int i = 1; i < 5000; ++i) f[i] /= (n * (n - 1) / 2);
  for (int i = 4999; i >= 1; --i) f[i] += f[i + 1];
  for (int i = 1; i < 5000; ++i)
    for (int j = 1; j + i < 5000; ++j) {
      res += (f[i] - f[i + 1]) * (f[j] - f[j + 1]) * f[i + j + 1];
    }
  printf("%.6lf\n", res);
}
