#include <bits/stdc++.h>
using namespace std;
const int MAX = 2005;
long long a[MAX];
long long diff[5003];
long long bit[10005];
void update(int pos, long long val) {
  for (int i = pos; i <= 10000; i += i & -i) bit[i] += val;
}
long long get(int pos) {
  long long r = 0;
  for (int i = pos; i; i -= i & -i) r += bit[i];
  return r;
}
int main() {
  long long n;
  scanf("%I64d", &n);
  for (int i = 0; i < n; i++) scanf("%I64d", &a[i]);
  sort(a, a + n);
  long long total = 0;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      diff[a[j] - a[i]]++;
      total++;
    }
  }
  for (int i = 1; i <= 5000; i++) {
    for (int j = 1; j <= 5000; j++) {
      long long r = diff[i] * diff[j];
      update(i + j, r);
    }
  }
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      int d = a[j] - a[i];
      ans += get(d - 1);
    }
  }
  total *= total * total;
  double sol = (ans * 1.0) / (1.0 * total);
  printf("%.8lf\n", sol);
  return 0;
}
