#include <bits/stdc++.h>
using namespace std;
int a[2005];
long long int cnt[5005];
long double p[5005];
long double s[5005];
void read(int &ss) {
  ss = 0;
  char ch = getchar();
  while (ch > '9' || ch < '0') ss *= 10, ss += ch - '0', ch = getchar();
  while (ch >= '0' && ch <= '9') ss *= 10, ss += ch - '0', ch = getchar();
  return;
}
vector<int> v;
int main() {
  memset(cnt, 0, sizeof cnt);
  int N;
  read(N);
  for (int i = 1; i <= N; i++) {
    read(a[i]);
  }
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j <= N; j++) {
      if (a[i] >= a[j]) continue;
      cnt[a[j] - a[i]]++;
      v.push_back(a[j] + a[i]);
    }
  }
  sort(v.begin(), v.end());
  s[0] = 0;
  for (int i = 1; i < 5005; i++) {
    p[i] = (long double)cnt[i] * 2 / N / (N - 1);
    s[i] = s[i - 1] + p[i];
  }
  long double ans = 0;
  for (int i = 1; i < 5005; i++) {
    for (int j = 1; j < i; j++) {
      ans += p[i] * p[j] * s[i - j - 1];
    }
  }
  printf("%.10lf\n", ans);
}
