#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> balls;
  balls.resize(n);
  for (int i = 0; i < n; i++) {
    cin >> balls[i];
  }
  vector<int> diff, sDiff;
  diff.resize(5001, 0);
  sDiff.resize(5001, 0);
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      diff[abs(balls[i] - balls[j])]++;
    }
  }
  sDiff[5000] = diff[5000];
  for (int i = 4999; i >= 0; i--) {
    sDiff[i] = sDiff[i + 1] + diff[i];
  }
  long long num = 0;
  for (int i = 0; i <= 5000; i++) {
    for (int j = 0; j <= 5000; j++) {
      if (i + j + 1 > 5000) continue;
      num += 1LL * diff[i] * diff[j] * sDiff[i + j + 1];
    }
  }
  long long denom = n * (n - 1) / 2;
  denom = denom * denom * denom;
  double ans = (1.0 * num) / (1.0 * denom);
  printf("%.7lf\n", ans);
}
