#include <bits/stdc++.h>
using namespace std;
const int M = 2005;
int w[M], dp[M << 2], cnt[M << 2];
int main() {
  int n, ans = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &w[i]);
  sort(w + 1, w + n + 1);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j < i; j++) cnt[w[i] - w[j]]++;
  for (int i = 1; i <= 5000; i++)
    for (int j = 1; j <= 5000; j++) dp[i + j] += cnt[i] * cnt[j];
  for (int i = 5000; i >= 0; i--) cnt[i] += cnt[i + 1];
  for (int i = 1; i <= 5000; i++) ans += dp[i] * cnt[i + 1];
  int tmp = n * n * n;
  ans /= 2;
  printf("%.10f", 1.0 * ans / tmp);
}
