#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; ++i) cin >> v[i];
  vector<int> w(5000);
  int a;
  long long k = 0;
  for (int i = 0; i < n; ++i)
    for (int j = i + 1; j < n; ++j) {
      if (v[i] > v[j])
        a = v[i] - v[j];
      else
        a = v[j] - v[i];
      ++w[a];
    }
  vector<int> z(5000);
  z[4999] = w[4999];
  for (int i = 4998; i >= 0; --i) {
    z[i] = z[i + 1] + w[i];
  }
  for (int i = 0; i < 5000; ++i)
    if (w[i] != 0) {
      for (int j = 0; i + j < 5000; ++j)
        if (w[j] != 0) {
          a = i + j;
          if (a < 4999) {
            long long q = z[a + 1];
            q *= w[i];
            q *= w[j];
            k += q;
          }
        }
    }
  long long p = n;
  p *= (p - 1);
  p /= 2;
  p *= p * p;
  double x = k;
  x /= p;
  cout << setprecision(10) << x << "\n";
  return 0;
}
