#include <bits/stdc++.h>
using namespace std;
int n;
int a[2020];
long long int b[5050];
long long int b_tot = 0;
long long int c[11000];
long long int c_tot = 0;
int main() {
  scanf("%d", &n);
  for (long long int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
  }
  for (long long int i = 0; i < n; ++i) {
    for (long long int j = i + 1; j < n; ++j) {
      ++b[abs(a[i] - b[i])];
      ++b_tot;
    }
  }
  for (long long int i = 0; i < 5050; ++i) {
    for (long long int j = 0; j < 5050; ++j) {
      long long int cnt = b[i] * b[j];
      c[i + j] += cnt;
      c_tot += cnt;
    }
  }
  double lessprob = 0.0;
  double ret = 0.0;
  for (long long int i = 0; i < 5050; ++i) {
    ret += lessprob * (double)b[i];
    lessprob += (double)c[i];
  }
  ret /= (double)b_tot;
  ret /= (double)c_tot;
  printf("%.10f\n", ret);
  return 0;
}
