#include <bits/stdc++.h>
using namespace std;
const int N = 2010;
const int M = 5010;
int n, a[N], dif[M];
long long ans, total, sum[2 * M], pre[2 * M];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      dif[a[j] - a[i]]++;
    }
  }
  for (int i = 0; i < M; i++) {
    for (int j = 0; j < M; j++) {
      sum[i + j] += dif[i] * dif[j];
    }
  }
  for (int i = 1; i < 2 * M; i++) {
    pre[i] = pre[i - 1] + sum[i];
  }
  for (int i = 1; i < 2 * M; i++) {
    ans += dif[i] * pre[i - 1];
  }
  total = n * (n - 1) / 2;
  total = total * total * total;
  cout << double(ans) / double(total);
  return 0;
}
