#include <bits/stdc++.h>
using namespace std;
const int N = 5100;
int n, a[N], tot;
double dp[5][6 * N];
map<int, int> mp;
double Dp(int i, int sum) {
  if (i == 3) {
    return (sum > 0);
  }
  double &ret = dp[i][sum + (15020)];
  if (ret == ret) return ret;
  ret = 0.0;
  for (auto x : mp) {
    double p = (x.second * 1.0) / tot;
    ret += p * Dp(i + 1, sum + (i == 2 ? x.first : -x.first));
  }
  return ret;
}
int main() {
  cin >> n;
  tot = (n * (n - 1)) / 2;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      int bla = a[j] - a[i];
      mp[bla]++;
    }
  }
  memset(dp, -1, sizeof dp);
  printf("%.9f\n", Dp(0, 0));
  return 0;
}
