#include <bits/stdc++.h>
using namespace std;
int v[10050], s[10050], n;
long double ans;
long long dp[10050], Ans0, Ans1;
inline int Read() {
  int x = 0;
  char y;
  do y = getchar();
  while (y < '0' || y > '9');
  do x = x * 10 + y - '0', y = getchar();
  while (y >= '0' && y <= '9');
  return x;
}
int main() {
  n = Read();
  for (int i = 1; i <= n; i++) v[i] = Read();
  sort(v + 1, v + n + 1);
  for (int i = 1; i < n; i++)
    for (int j = i + 1; j <= n; j++) s[v[j] - v[i]]++;
  for (int i = 1; i < 10050; i++)
    if (s[i])
      for (int j = 1; j < 10050; j++) dp[i + j] += 1LL * s[i] * s[j];
  Ans1 = n * (n - 1) / 2LL * n * (n - 1) / 2 * n * (n - 1) / 2;
  for (int i = 2; i < 10050; i++)
    dp[i - 1] += dp[i - 2], Ans0 += s[i] * dp[i - 1];
  printf("%.9lf\n", (double)((long double)(Ans0) / Ans1) + 1e-12);
  return 0;
}
