#include <bits/stdc++.h>
using namespace std;
int n, d;
int a[5000];
long long diff[5000];
long long sum[5000];
long double res;
long double tmp, ch;
int main() {
  res = 0;
  scanf("%d\n", &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) {
      d = a[i] - a[j];
      if (d < 0) d = -d;
      ++diff[d];
    }
  sum[0] = diff[0];
  for (int i = 1; i < 5000; ++i) sum[i] += diff[i];
  int k;
  ch = n * (n - 1) / 2.0;
  for (int i = 4999; i > 0; --i) {
    tmp = 0;
    for (int j = i - 1; j > 0; --j) {
      k = i - j - 1;
      k = min(k, j);
      if (j == k) {
        tmp += (diff[j] * diff[k]) / ch;
        k -= 1;
      }
      if (k > 0) {
        tmp += (2 * diff[j] * sum[k]) / ch;
      }
    }
    tmp = tmp / ch;
    tmp = tmp * diff[i];
    tmp = tmp / ch;
    res += tmp;
  }
  printf("%.20Lf", res);
  return 0;
}
