#include <bits/stdc++.h>
using namespace std;
const int M = 1000000007;
int main() {
  long long n, i, j, A = 0;
  long long arr[5001];
  long long suf[5001];
  cin >> n;
  vector<long long> v(n);
  for (i = 0; i < n; i++) cin >> v[i];
  sort(v.begin(), v.end());
  for (i = 0; i < 5001; i++) {
    arr[i] = 0;
    suf[i] = 0;
  }
  for (i = 0; i < n; i++)
    for (j = 0; j < i; j++) arr[v[i] - v[j]]++;
  suf[0] = 0;
  for (i = 1; i < 5001; i++) suf[i] = suf[i - 1] + arr[i];
  for (i = 0; i < 5001; i++)
    for (j = i - 1; j > 0; j--) {
      A += (arr[j] * suf[i - j - 1] * arr[i]);
    }
  long long B;
  B = (n * n * n * (n - 1) * (n - 1) * (n - 1)) / 8;
  double d;
  d = (double)A / (double)B;
  printf("%.9lf\n", d);
}
