#include <bits/stdc++.h>
long long n, a[2010], b[5010], c[10010];
double ans;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++)
      b[((a[i] - a[j]) > 0 ? (a[i] - a[j]) : -(a[i] - a[j]))]++;
  for (int i = 1; i <= 5000; i++)
    for (int j = 1; j <= 5000; j++) c[i + j] += b[i] * b[j];
  for (int i = 1; i <= 10000; i++) c[i] += c[i - 1];
  int t = n * (n - 1) / 2;
  for (int i = 5000; i >= 2; i--) ans += (double)b[i] * c[i - 1] / t;
  printf("%.10lf", ans / t / t);
}
