#include <bits/stdc++.h>
using namespace std;
int n;
int a[2002];
int b[5005];
long long d[5005 * 2];
int main() {
  scanf("%d", &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 = 0; j < i; ++j) ++b[a[i] - a[j]];
  for (int i = 0; i < 5005; ++i)
    for (int j = i; j < 5005; ++j) d[i + j] += 1LL * b[i] * b[j];
  for (int i = 1; i < 5005 + 5005; ++i) d[i] += d[i - 1];
  long double ans = 0;
  int k = n * (n - 1) / 2;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < i; ++j) {
      ans += long double(d[a[i] - a[j] - 1]) / k;
    }
  long long total = 1LL * k * k;
  printf("%e\n", double(ans / total));
  return 0;
}
