#include <bits/stdc++.h>
using namespace std;
int const bound = 1e6 + 2, N = 5e5 + 2;
long long OO = 1e18;
double eps = 1e-6;
int oo = 1e9, mod = oo + 7;
double prob[10001];
int cum[5001], aa[2001];
int main() {
  int n;
  cin >> n;
  for (int(i) = 0; (i) < (n); (i)++) cin >> aa[i];
  sort(aa, aa + n);
  for (int(i) = 0; (i) < (n); (i)++)
    for (int j = i + 1; j < n; j++) cum[aa[j] - aa[i]]++;
  for (int i = 1; i <= 5000; i++)
    for (int j = 1; j <= 5000; j++)
      prob[i + j] += 4.0 * (cum[i] / (1.0 * n * (n - 1))) *
                     (1.0 * cum[j] / (n * 1.0 * (n - 1)));
  double psum = 0;
  int rem = n * (n - 1) / 2;
  for (int(i) = 1; (i) <= (5000); (i)++) {
    rem -= cum[i];
    if (prob[i]) psum += rem * 2.0 * prob[i] / (n * 1.0 * (n - 1));
  }
  printf("%.10f\n", psum);
  return 0;
}
