#include <bits/stdc++.h>
using namespace std;
int a[2005];
double dif1[5005];
double dif2[10050];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  double ways = (n * (n - 1)) / 2;
  for (int i = 0; i < n - 1; i++) {
    for (int j = i + 1; j < n; j++) {
      dif1[abs(a[i] - a[j])] += 1.0 / ways;
    }
  }
  for (int i = 0; i <= 5000; i++) {
    for (int j = 0; j <= 5000; j++) {
      if (dif1[i] > 1e-6 && dif1[j] > 1e-6) {
        dif2[i + j] += dif1[i] * dif1[j];
      }
    }
  }
  double ret;
  for (int i = 0; i <= 5000; i++) {
    if (dif1[i] < 1e-6) continue;
    double temp = dif1[i];
    for (int j = 0; j < i; j++) {
      if (dif2[j] < 1e-6) continue;
      ret += temp * dif2[j];
    }
  }
  cout << setprecision(15) << ret;
}
