#include <bits/stdc++.h>
using namespace std;
const int N = 100000 + 10;
const int M = 1000000007;
const double PI = atan(1) * 4;
const int oo = 1000000000;
int n, v[2001], c[5001], d[10001];
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) scanf("%d", &v[i]);
  sort(v, v + n);
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < i; ++j) ++c[v[i] - v[j]];
  for (int i = 0; i < 5001; ++i)
    for (int j = 0; j < 5001; ++j) d[i + j] += c[i] * c[j];
  long long ct = 0, omega = 1ll * n * n * n * (n - 1) * (n - 1) * (n - 1) / 8;
  for (int i = 0; i < 5001; ++i)
    for (int j = 0; j < i; ++j) ct += c[i] * d[j];
  printf("%.9lf\n", (double)ct / omega);
}
