#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5005, BASE = 3137, MOD = 1e9 + 7, inf = 1000000009;
const double PI = 3.1415926535;
const int dx[] = {0, -1, 0, 1, 1, -1, 1, -1};
const int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
int n;
int arr[MAXN];
int raz[MAXN], suffix[MAXN];
long long cnt = 0ll;
double sol = 0.0;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
  sort(arr, arr + n);
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) raz[arr[j] - arr[i]]++;
  }
  long long komb = n * (n - 1) / 2;
  for (int i = 4999; i >= 0; i--) {
    suffix[i] = suffix[i + 1];
    suffix[i] += raz[i];
  }
  for (int i = 1; i < 5000; i++) {
    for (int j = 1; j < 5000; j++) {
      if (i + j + 1 >= 5000) break;
      cnt += (long long)(raz[i] * raz[j] * suffix[i + j + 1]);
    }
  }
  printf("%.9lf\n", (double)cnt / komb / komb / komb * 1.0);
  return 0;
}
