#include <bits/stdc++.h>
using namespace std;
int n, a[2005], cnt[5005], f[2][5005];
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  for (int i = 1; i <= n; ++i) {
    for (int j = i + 1; j <= n; ++j) {
      int gap = fabs(a[i] - a[j]);
      cnt[gap]++;
    }
  }
  f[0][0] = 1;
  for (int i = 1; i <= 2; ++i) {
    for (int j = 1; j <= 5000; ++j) {
      for (int k = 0; k < j; ++k) {
        f[i][j] += f[i - 1][k] * cnt[j - k];
      }
    }
  }
  double res = 0;
  for (int i = 1; i <= 5000; ++i) {
    for (int j = i + 1; j <= 5000; ++j) {
      res += f[2][j - i] * cnt[j];
    }
  }
  for (int i = 1; i <= 3; ++i) res = 2 * res / (n * (n - 1));
  printf("%.12lf", res);
}
