#include <bits/stdc++.h>
using namespace std;
long long int nss[2001];
long long int positive[5001], negative[5001], ans[5001];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> nss[i];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < i; j++) {
      long long int diff = nss[i] - nss[j];
      positive[abs(diff)]++;
      negative[abs(diff)]++;
    }
  }
  for (int i = 0; i < 5001; i++) {
    for (int j = 0; j < 5001; j++) {
      if (i + j < 5001) ans[i + j] += negative[i] * negative[j];
    }
  }
  long long int total_ways = 0, wins = 0;
  for (int i = 0; i < 5001; i++) {
    for (int j = 0; j < 5001; j++) {
      if (i > j) total_ways += positive[i] * ans[j];
    }
  }
  long long int total = 0;
  for (int i = 0; i < 5001; i++) total += positive[i];
  wins = total * total * total;
  cout << fixed;
  cout << setprecision(10);
  cout << double(total_ways) / double(wins) << endl;
}
