#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
int main() {
  int n;
  int a[2222] = {0};
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  long long int first[10005], second[10005];
  memset(first, 0, sizeof(first));
  memset(second, 0, sizeof(second));
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j < i; j++) {
      first[a[i] - a[j]]++;
    }
  }
  for (int i = 1; i < 5001; i++) {
    for (int j = 1; j < 5001; j++) {
      second[i + j] += first[i] * first[j];
    }
  }
  long long int sum = 0;
  for (int i = 1; i < 5001; i++) {
    for (int j = 1; j < i; j++) {
      sum += first[i] * second[j];
    }
  }
  long long int mu = n * (n - 1) / 2;
  long long int m = mu * mu * mu;
  double out = double(sum) / m;
  printf("%.10f\n", out);
  return 0;
}
