#include <bits/stdc++.h>
using namespace std;
int Set(int N, int pos) { return N = N | (1 << pos); }
int reset(int N, int pos) { return N = N & ~(1 << pos); }
bool check(int N, int pos) { return (bool)(N & (1 << pos)); }
int cas = 1;
int dxx[] = {-1, -1, -1, 0, 0, 1, 1, 1};
int dyy[] = {-1, 0, 1, -1, 1, -1, 0, 1};
int dx[] = {-1, 0, 0, 1};
int dy[] = {0, -1, 1, 0};
long long ai[2003];
long long bi[4000006];
long long su[5005];
long long yes, no;
long long cnt = 0;
int main() {
  long long n;
  scanf("%lld", &n);
  for (long long i = 0; i < n; i++) scanf("%lld", &ai[i]);
  sort(ai, ai + n);
  for (long long i = 0; i < n; i++) {
    for (long long j = i + 1; j < n; j++) {
      bi[ai[j] - ai[i]]++;
      cnt++;
    }
  }
  su[5001] = 0.0;
  for (long long i = 5000; i >= 0; i--) {
    su[i] = su[i + 1] + bi[i];
  }
  yes = 0;
  no = 0;
  for (long long i = 1; i <= 5000; i++)
    for (long long j = 1; j <= 5000; j++) {
      if (bi[i] >= 1.0 && bi[j] >= 1.0) {
        yes += (bi[i] * bi[j] * su[i + j + 1]);
        no += (bi[i] * bi[j] * (cnt - su[i + j + 1]));
      }
    }
  printf("%.10lf\n", 1.0 * yes / (yes + no));
}
