#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const double eps = 1e-8;
const double PIE = acos(-1.0);
int sign(double x) { return x < -eps ? -1 : x > eps; }
const int maxn = 10000 + 10;
int n;
int a[maxn];
long long p[maxn], sum[maxn];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  sort(a + 1, a + 1 + n);
  for (int i = 1; i <= n; i++) {
    p[i] = 0;
  }
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++) {
      p[a[j] - a[i]]++;
    }
  sum[5000 + 1] = 0;
  for (int i = 5000; i >= 1; i--) {
    sum[i] = sum[i + 1] + p[i];
  }
  double ans = 0.0;
  for (int i = 1; i <= 5000; i++)
    for (int j = 1; j <= 5000; j++) {
      ans += p[i] * p[j] * sum[i + j + 1];
    }
  double round = 1.0 * n * (n - 1) / 2.0;
  for (int i = 1; i <= 3; i++) {
    ans /= round;
  }
  printf("%.6f\n", ans);
  return 0;
}
