#include <bits/stdc++.h>
using namespace std;
inline long long mod(long long n, long long m) {
  long long ret = n % m;
  if (ret < 0) ret += m;
  return ret;
}
long long gcd(long long a, long long b) { return (b == 0 ? a : gcd(b, a % b)); }
long long exp(long long a, long long b, long long m) {
  if (b == 0) return 1;
  if (b == 1) return mod(a, m);
  long long k = mod(exp(a, b / 2, m), m);
  if (b & 1) {
    return mod(a * mod(k * k, m), m);
  } else
    return mod(k * k, m);
}
const long long MAXS = 5050;
long long dp1[MAXS], dp2[2 * MAXS], dp3[MAXS];
const long long MAXN = 2020;
long long a[MAXN];
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n;
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= n; j++) {
      if (i == j) continue;
      if (a[i] > a[j]) {
        dp1[a[i] - a[j]] += 1;
        dp3[a[i] - a[j]] += 1;
      }
    }
  }
  double prob = 0;
  for (long long i = 1; i <= 5000; i++) {
    for (long long j = 1; j <= 5000; j++) {
      dp2[i + j] += dp1[i] * dp1[j];
    }
  }
  for (long long i = 1; i <= 5000; i++) {
    for (long long j = 1; j < i; j++) {
      prob += dp3[i] * dp2[j];
    }
  }
  prob = 1.0 * prob / (1.0 * n * n * n);
  cout << setprecision(6) << fixed;
  cout << prob << "\n";
}
