#include <bits/stdc++.h>
using namespace std;
long long df[5005];
long long df2[5005];
int a[2005];
int main() {
  int n;
  cin >> n;
  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) {
      ++df[a[j] - a[i]];
    }
  }
  df[0] = 0;
  for (int i = 0; i <= 5000; ++i) {
    for (int j = 0; j <= 5000; ++j) {
      if (i + j <= 5000) {
        df2[i + j] += df[i] * df[j];
      }
    }
  }
  for (int i = 1; i <= 5000; ++i) {
    df2[i] += df2[i - 1];
  }
  long long total = 0;
  for (int i = 1; i <= 5000; ++i) {
    total += df[i] * df2[i - 1];
  }
  double ret = (double)total;
  ret /= n * (n - 1) / 2;
  ret /= n * (n - 1) / 2;
  ret /= n * (n - 1) / 2;
  cout << fixed << setprecision(10) << ret << endl;
  return 0;
}
