#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2000, MAXNUM = 5000;
int main() {
  int n;
  while (scanf("%d", &n) == 1) {
    int ar[MAXN];
    for (int i = 0; i < n; ++i) {
      scanf("%d", &ar[i]);
    }
    sort(ar, ar + n);
    int oc_diff[MAXNUM];
    memset(oc_diff, 0, sizeof(oc_diff));
    for (int i = n - 1; i > 0; --i) {
      for (int j = 0; j < i; ++j) {
        ++oc_diff[ar[i] - ar[j]];
      }
    }
    long long oc_diff_2[MAXNUM];
    memset(oc_diff_2, 0, sizeof(oc_diff_2));
    for (int i = 0; i < MAXNUM; ++i) {
      for (int j = 0; j < MAXNUM; ++j) {
        if (i + j >= MAXNUM) {
          break;
        }
        oc_diff_2[i + j] += (long long)oc_diff[i] * oc_diff[j];
      }
    }
    long long diff_2 = 0, ret = 0;
    for (int i = 1; i < MAXNUM; ++i) {
      ret += oc_diff[i] * diff_2;
      diff_2 += oc_diff_2[i];
    }
    long long t = n * (n - 1) / 2;
    t = t * t * t;
    printf("%.9lf\n", ret * 1.0 / (t * 1.0));
  }
  return 0;
}
