#include <bits/stdc++.h>
using namespace std;
const int maxn = 1;
long long b[2005];
long long a[5005];
long long c[5005];
long long n, m, bb, i, j, ans;
double p;
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  bb = n * n * n;
  for (i = 1; i <= n; i++) cin >> b[i];
  sort(b + 1, b + n + 1);
  m = b[n] - b[1];
  for (i = 1; i <= n - 1; i++)
    for (j = i + 1; j <= n; j++) {
      a[b[j] - b[i]]++;
    }
  for (i = 1; i <= m; i++) c[i] = c[i - 1] + a[i];
  for (i = m; i >= 1; i--)
    for (j = 1; j <= i - 1; j++)
      if (a[i] != 0 && a[j] != 0 && a[i - j] != 0) {
        ans += a[i] * a[j] * a[j];
      }
  p = 1.0 * ans / bb;
  printf("%.10f\n", p);
}
