#include <bits/stdc++.h>
using namespace std;
const int N = 1e4 + 4;
const int INF = 1e9 + 15;
const int MOD = 1e9 + 7;
const long long INF64 = 1e18 + 3;
int dif[N];
long double pdif[N];
int a[N];
int n;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  int mxdif = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (j == i) continue;
      if (a[i] - a[j] > 0) {
        dif[a[i] - a[j]]++;
        mxdif = max(mxdif, a[i] - a[j]);
      }
    }
  }
  int mx = 0;
  for (int i = 1; i <= mxdif; i++) {
    for (int j = 1; j <= mxdif; j++) {
      long double pdifi = ((double)dif[i]) / double(n * (n - 1) / 2);
      long double pdifj = ((double)dif[j]) / double(n * (n - 1) / 2);
      pdif[i + j] += pdifj * pdifi;
      if (dif[i + j] > 0) mx = max(mx, i + j);
    }
  }
  sort(a, a + n);
  double ans = 0;
  for (int d = 1; d <= mx; d++) {
    int j = n - 1;
    double td = 0;
    int cnt = 0;
    for (int i = n - 1; i >= 0; i--) {
      while (a[i] - a[j] <= d && j > 0) {
        j--;
      }
      if (a[i] - a[j] > d) {
        cnt += (j + 1);
      }
    }
    td = ((double)cnt) / (double)(n * (n - 1) / 2);
    ans += td * pdif[d];
  }
  printf("%.7lf", ans);
  return 0;
}
