#include <bits/stdc++.h>
using namespace std;
long long dif1[5003];
long long dif2[5003];
long long ar[6000];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> ar[i];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      if (i != j && ar[i] > ar[j]) dif1[ar[i] - ar[j]]++;
    }
  for (int i = 0; i <= 5000; i++)
    for (int j = 0; j <= 5000; j++)
      dif2[i + j] = dif2[i + j] + (dif1[i] * dif1[j]);
  for (int i = 1; i <= 5000; i++) dif2[i] = dif2[i] + dif2[i - 1];
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (i != j && ar[i] > ar[j]) ans += dif2[ar[i] - ar[j] - 1];
    }
  }
  double x = (n * (n - 1)) / 2.0;
  x = x * x * x;
  double fans = ans / x;
  printf("%.7lf\n", fans);
  return 0;
}
