#include <bits/stdc++.h>
using namespace std;
int n, a[2003], m;
double prob[5003], sum[5003], ans = 0;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  sort(a, a + n);
  m = n * (n - 1) / 2;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      prob[a[j] - a[i]]++;
    }
  }
  for (int i = 5000; i >= 0; i--) {
    prob[i] /= m;
    sum[i] = sum[i + 1] + prob[i];
  }
  putchar('\n');
  for (int i = 0; i <= 5000; i++) {
    for (int j = 0; j <= 5000; j++) {
      ans += (prob[i] * prob[j] * sum[j + i + 1]);
    }
  }
  printf("%lf\n", ans);
  return 0;
}
