#include <bits/stdc++.h>
using namespace std;
int Scan() {
  int res = 0, ch, flag = 0;
  if ((ch = getchar()) == '-')
    flag = 1;
  else if (ch >= '0' && ch <= '9')
    res = ch - '0';
  while ((ch = getchar()) >= '0' && ch <= '9') res = res * 10 + ch - '0';
  return flag ? -res : res;
}
void Out(int a) {
  if (a > 9) Out(a / 10);
  putchar(a % 10 + '0');
}
long long c1[10005], c2[10005];
int n;
int a[2002];
int main() {
  while (scanf("%d", &n) == 1) {
    for (int i = 0; i < n; i++) a[i] = Scan();
    memset((c1), 0, sizeof((c1)));
    for (int i = 1; i < n; i++) {
      for (int j = 0; j < i; j++) {
        c1[abs(a[i] - a[j])]++;
      }
    }
    vector<pair<int, int> > b;
    for (int i = 1; i <= 5000; i++) {
      if (c1[i] > 0) {
        b.push_back(make_pair(i, c1[i]));
      }
    }
    memset((c2), 0, sizeof((c2)));
    for (int i = 1; i <= 5000; i++) {
      if (c1[i] > 0) {
        for (int j = 1; j <= 5000; j++) {
          if (c1[j] > 0) {
            c2[i + j] += c1[i] * c1[j];
          }
        }
      }
    }
    long long cc = 0;
    for (int i = 1; i <= 10000; i++) {
      if (c2[i] > 0) {
        int l = 0, r = b.size() - 1;
        int ans = -1;
        while (l <= r) {
          int mid = (l + r) >> 1;
          if (b[mid].first > i) {
            ans = mid;
            r = mid - 1;
          } else
            l = mid + 1;
        }
        if (ans >= 0) {
          for (int j = ans; j < b.size(); j++) {
            cc += c2[i] * b[j].second;
          }
        }
      }
    }
    long long t = n * n * n * (n - 1) * (n - 1) * (n - 1) / 8;
    printf("%.8f\n", 1.0 * cc / t);
  }
  return (0);
}
