#include <bits/stdc++.h>
using namespace std;
int bms[5001];
int sum[5001];
int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  sort(v.begin(), v.end());
  memset(bms, 0, sizeof(bms));
  memset(sum, 0, sizeof(sum));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < i; j++) {
      bms[v[i] - v[j]]++;
    }
  }
  for (int i = 1; i <= 5000; i++) {
    sum[i] = bms[i] + sum[i - 1];
  }
  double up = 0;
  double down = 0;
  for (int i = 1; i <= 5000; i++) {
    if (bms[i] == 0) continue;
    for (int j = 1; j <= 5000; j++) {
      if (bms[j] == 0) continue;
      down += (double)bms[i] * bms[j] * (sum[5000] - sum[0]);
      up += (double)bms[i] * bms[j] * (sum[5000] - sum[min(5000, i + j)]);
    }
  }
  printf("%.10lf\n", up / down);
  return 0;
}
