#include <bits/stdc++.h>
using namespace std;
int v[100010], i, n, sum, pos, x, a, h[100010], j, m, b, k[100010];
double X, Y, Z;
char c;
ifstream fin(".in");
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> v[i];
  }
  sort(v + 1, v + n + 1);
  for (i = 1; i <= n; i++) {
    for (j = i + 1; j <= n; j++) {
      k[v[j] - v[i]]++;
    }
  }
  for (i = 5000; i >= 1; i--) {
    h[i] = h[i + 1] + k[i];
  }
  for (i = 1; i <= 5000; i++) {
    for (j = 1; j <= 5000; j++) {
      sum += k[i] * k[j] * h[i + j + 1];
    }
  }
  b = n * (n - 1) / 2;
  b = b * b * b;
  X = sum;
  Y = b;
  Z = X / Y;
  cout << setprecision(10) << fixed << Z;
  return 0;
}
