#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9;
const int SIZE = 1e6 + 5;
const long long INF = 1LL << 55;
const double eps = 1e-10;
int d[2009];
long long m1[10009];
long long m2[20009];
long long m3[25009];
int main() {
  int(n);
  scanf("%d", &n);
  for (int i = 0; i < (n); ++i) {
    scanf("%d", &(d[i]));
  }
  sort(d, d + n);
  for (int i = 0; i < (n); ++i) {
    for (int j = (i + 1); j < (n); ++j) {
      m1[d[j] - d[i] + 5000]++;
    }
  }
  for (int i = 0; i < (10003); ++i) {
    for (int j = 0; j < (10003); ++j) {
      m2[i + j] += m1[i] * m1[j];
    }
  }
  for (int i = 0; i < (15003); ++i) {
    for (int j = 0; j < (10003); ++j) {
      m3[i - j + 10000] += m2[i] * m1[j];
    }
  }
  long long ans = 0;
  for (int i = 0; i < (15000); ++i) {
    ans += m3[i];
  }
  long long den = n * (n - 1) / 2;
  den = den * den * den;
  printf("%.12f", (double)ans / (double)den);
}
