#include <bits/stdc++.h>
using namespace std;
int v[2005];
double prob1[5005], prob2[10005];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &v[i]);
  sort(v, v + n);
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++)
      prob1[v[j] - v[i]] += (2.0 / ((double)n * (n - 1)));
  for (int i = 1; i < 5000; i++)
    for (int j = 1; j < 5000; j++) prob2[i + j] += prob1[i] * prob1[j];
  double ans = 0;
  for (int i = 1; i < 5000; i++)
    for (int j = 1; j < i; j++) ans += prob1[i] * prob2[j];
  printf("%.15lf\n", ans);
  return 0;
}
