#include <bits/stdc++.h>
using namespace std;
int a[2022], d[5022 + 2], tot[5022 + 2];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      d[a[j] - a[i]]++;
    }
  }
  for (int i = 5022 - 1; i >= 1; i--) tot[i] = tot[i + 1] + d[i];
  double ans = 0;
  for (int i = 1; i < 5022; i++) {
    for (int j = 1; j < 5022; j++) {
      ans += (double)d[i] * d[j] * tot[min(5022, i + j + 1)];
    }
  }
  ans = ans * 8 / n / n / n / (n - 1) / (n - 1) / (n - 1);
  printf("%.10lf\n", ans);
  return 0;
}
