#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e3;
const int score_max = 5e3;
int num[maxn + 10];
long long count_winscore[score_max + 10], A_score[score_max * 2 + 10];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &num[i]);
  sort(num, num + n);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < i; j++) count_winscore[num[i] - num[j]]++;
  for (int i = 1; i <= 5000; i++)
    for (int j = 1; j <= 5000; j++)
      A_score[i + j] += count_winscore[i] * count_winscore[j];
  for (int j = 1; j <= 10000; j++) A_score[j] += A_score[j - 1];
  long long ans = 0;
  for (int i = 1; i <= 5000; i++) ans += count_winscore[i] * A_score[i - 1];
  long long k = n * (n - 1) / 2;
  double possibility = (double)ans / k / k / k;
  printf("%.10f\n", possibility);
  return 0;
}
