#include <bits/stdc++.h>
using namespace std;
long long cnt[100010];
int main(int argc, char const *argv[]) {
  long long n;
  scanf("%lld", &n);
  long long t = (n * (n - 1)) / 2;
  int a[n];
  for (int i = 0; i < n; i++) {
    scanf("%d", a + i);
  }
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      cnt[a[j] - a[i]]++;
    }
  }
  for (int i = 1; i < 100010; i++) cnt[i] += cnt[i - 1];
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < i - 1; j++) {
      int t = a[i] - a[j];
      ans += ((t == 0) ? 0 : cnt[t - 1]);
    }
  }
  long double res = (long double)ans / (long double)(t * t);
  res /= (long double)t;
  printf("%.9Lf\n", res);
  return 0;
}
