#include <bits/stdc++.h>
using namespace std;
int n, i, j;
long long cur, tot;
double ans, c;
int a[2022];
int cn[100100];
int f[100100];
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++) cn[abs(a[i] - a[j])]++;
  memset(f, 0, sizeof(f));
  for (int i = 5005; i >= 0; i--) f[i] = f[i + 1] + cn[i];
  for (int i = 1; i <= 5005; i++)
    for (int j = 1; j <= 5005; j++) {
      cur = 1ll * cn[i] * cn[j];
      tot += cur * f[i + j + 1];
    }
  c = (1.0 * n * (n - 1)) / 2.0;
  ans = tot / (c * c * c);
  cout.precision(7);
  cout << fixed << ans << "\n";
  return 0;
}
