#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  int mem[5001];
  memset(mem, 0, sizeof(mem));
  for (int i = 1; i < n; i++) {
    for (int j = 0; j < i; j++) {
      int tmp = a[i] - a[j];
      mem[tmp]++;
    }
  }
  int sum[5001];
  int add = 0;
  for (int i = 0; i < 5001; i++) {
    sum[i] = add + mem[i];
    add += mem[i];
  }
  double total = (n * (n - 1)) / 2;
  double prob = 0;
  for (int i = 1; i <= 5000; i++) {
    for (int j = 1; j < i; j++) {
      double tmp = 1.0;
      tmp *= (mem[j] * 1.0) / total;
      tmp *= (sum[i - j - 1] * 1.0) / total;
      tmp *= (mem[i] * 1.0) / total;
      prob += tmp;
    }
  }
  printf("%.8f\n", prob);
}
