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