#include <bits/stdc++.h>
using namespace std;
int n, a[2005], d[5005], cnt[5005];
int main() {
  while (~scanf("%d", &n)) {
    memset(d, 0, sizeof(d));
    memset(cnt, 0, sizeof(cnt));
    for (int i = 1; i <= n; ++i) {
      scanf("%d", &a[i]);
    }
    sort(a + 1, a + n + 1);
    for (int i = 1; i <= n; ++i) {
      for (int j = i + 1; j <= n; ++j) {
        ++d[a[j] - a[i]];
      }
    }
    for (int i = 5000 - 1; i > 0; --i) {
      cnt[i] = cnt[i + 1] + d[i + 1];
    }
    double ans = 0;
    for (int i = 1; i <= n; ++i) {
      for (int j = (d[i] == 1 ? i + 1 : i); j <= n; ++j) {
        for (int k = 1; k <= d[i]; ++k) {
          if (i == j) ++k;
          ans += 1.0 * cnt[d[i] + d[j]];
        }
      }
    }
    double x = 1.0 * n * (n - 1) / 2;
    printf("%.7f\n", ans / x / x / x / 2);
  }
  return 0;
}
