#include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
long long pw(long long a, long long b) {
  long long r = 1;
  while (b > 0) {
    if (b & 1) {
      r = (r * a) % MOD;
    }
    b = b >> 1;
    a = (a * a) % MOD;
  }
  return (r) % MOD;
}
int a[5000];
double win_p[5555], lose_p[5555], sum_winp[5555];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (i == j) continue;
      if (a[i] > a[j]) {
        win_p[a[i] - a[j]]++;
      } else {
        lose_p[a[j] - a[i]]++;
      }
    }
  }
  double deno = 1.0 * n * (n - 1) / 2.0;
  for (int i = 0; i < 5001; i++) {
    win_p[i] /= deno;
    lose_p[i] /= deno;
  }
  for (int i = 1; i < 5001; i++) {
    for (int j = 1; j < 5001; j++) {
      if (i + j >= 5000) continue;
      sum_winp[i + j] = win_p[i] * win_p[j];
    }
  }
  double ans = 0;
  for (int i = 1; i < 5001; i++) {
    for (int j = i + 1; j < 5001; j++) {
      ans += (sum_winp[i] * lose_p[j]);
    }
  }
  cout.precision(12);
  cout << ans;
  printf("\n");
  return 0;
}
