#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return a * (b / gcd(a, b)); }
long long power(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = ((res % p) * (x % p)) % p;
    y = y >> 1;
    x = ((x % p) * (x % p)) % p;
  }
  return res % p;
}
long long raichu(long long x, long long y) {
  long long res = 1;
  while (y > 0) {
    if (y & 1) res = ((res) * (x));
    y = y >> 1;
    x = ((x) * (x));
  }
  return res;
}
bool isprime(long long n) {
  if (n < 2)
    return false;
  else if (n == 2)
    return true;
  else if (n % 2 == 0)
    return false;
  else {
    long long z = sqrt(n);
    for (int i = 0; i < z - 1; i++)
      if (n % (i + 2) == 0) return false;
    return true;
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int tests = 1, Tests;
  Tests = tests;
  while (tests--) {
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++) cin >> a[i];
    map<int, int> M;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (i == j) continue;
        int z = a[i] - a[j];
        M[z]++;
      }
    }
    vector<pair<int, int> > pos, neg;
    for (auto i : M) {
      if (i.first > 0) {
        pos.push_back(i);
      } else if (i.first < 0) {
        neg.push_back(i);
      }
    }
    long long total =
        (int)neg.size() * 1LL * (int)neg.size() * 1LL * (int)pos.size();
    long long cnt = 0;
    int m = (int)neg.size();
    for (int i = 0; i < m; i++) {
      int idx = (int)pos.size() - 1;
      int chk = 0;
      for (int j = 0; j < m; j++) {
        int z = neg[i].first + neg[j].first;
        while (idx >= 0 && pos[idx].first > -z) {
          chk += pos[idx].second;
          idx--;
        }
        cnt += chk;
      }
    }
    cout << fixed << setprecision(10)
         << ((long double)cnt) / ((long double)total);
  }
  return 0;
}
