#include <bits/stdc++.h>
using namespace std;
long long n, a[2222], b[5555], tl;
long long s, dp[5555];
int main() {
  scanf("%I64d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%I64d", &a[i]);
  }
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      b[abs(a[i] - a[j])]++;
      tl++;
    }
  }
  for (int i = 1; i <= 5000; i++) {
    long long t = 0;
    for (int j = 1; j < i; j++) {
      t += (long long)b[j] * b[i - j];
    }
    dp[i] = dp[i - 1] + t * b[i];
  }
  printf("%.9f", (double)dp[5000] / tl / tl / tl);
}
