#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 2000 + 1;
const int MAX_VAL = 5000;
int diffs[MAX_VAL + 1];
int sum[MAX_VAL + 1];
int A[MAX_N];
int N;
int query(int i, int j) {
  if (i > j) return 0;
  int s = sum[j];
  if (i > 0) s -= sum[i - 1];
  return s;
}
int nC2(int n) { return n * (n - 1) / 2; }
int main() {
  ios_base::sync_with_stdio(false);
  cin >> N;
  for (int i = 1; i <= N; ++i) cin >> A[i];
  sort(A + 1, A + N + 1);
  for (int i = 1; i <= N; ++i)
    for (int j = i + 1; j <= N; ++j) {
      assert(A[i] < A[j]);
      diffs[A[j] - A[i]]++;
    }
  sum[0] = diffs[0];
  for (int i = 1; i <= MAX_VAL; ++i) sum[i] = sum[i - 1] + diffs[i];
  double nCr = nC2(N);
  double total = 1.0 * nCr * nCr * nCr;
  double good = 0;
  for (int i = 0; i <= MAX_VAL; ++i)
    for (int j = i; j <= MAX_VAL; ++j) {
      int tmp = diffs[i] * diffs[j];
      int bigger = query(i + j + 1, MAX_VAL);
      good += tmp * bigger;
    }
  cout << fixed << setprecision(10) << good / total << "\n";
  return 0;
}
