#include <bits/stdc++.h>
using namespace std;
template <typename X>
inline X sqr(const X& a) {
  return a * a;
}
template <typename X>
inline X abs(const X& a) {
  return a < 0 ? -a : a;
}
int n;
long long a[2001], b[5002], suffix[5005];
void init() {
  cin >> n;
  long long tmp;
  for (int i = 0; i <= n - 1; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
}
void solve() {
  long double ans = 0;
  for (int i = 0; i <= n - 1; i++)
    for (int j = i + 1; j < n; j++) {
      int tmp = a[j] - a[i];
      b[tmp]++;
    }
  for (int i = 5000; i >= 0; i--) {
    suffix[i] = suffix[i + 1];
    if (b[i + 1]) suffix[i] += b[i + 1];
  }
  for (int i = 1; i < 5001; i++) {
    for (int j = 1; j < 5001; j++) {
      ans += b[i] * b[j] * suffix[i + j];
    }
  }
  long double finalans =
      ans / powl((long double)(n * (n - 1) / 2), (long double)3);
  cout << finalans << '\n';
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(20);
  init();
  solve();
  return 0;
}
