#include <bits/stdc++.h>
using namespace std;
int a[2002];
int d[5001];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  sort(a, a + n);
  long winsCount = 0;
  int maxDiff = 0;
  for (int i = 1; i < n; ++i) {
    for (int j = 0; j < i; ++j) {
      maxDiff = max(maxDiff, a[i] - a[j]);
      d[a[i] - a[j]]++;
      winsCount++;
    }
  }
  double totalWins = winsCount * winsCount * winsCount;
  double successWins = 0;
  for (int i = 1; i < maxDiff + 1; ++i) {
    if (d[i] > 0)
      for (int j = 1; j < maxDiff + 1; ++j) {
        if (d[j] > 0) {
          for (int k = i + j + 1; k < maxDiff + 1; ++k) {
            if (d[k] > 0) successWins += d[k] * d[i] * d[j];
          }
        }
      }
  }
  cout << setprecision(20) << successWins / totalWins;
  return 0;
}
