#include <bits/stdc++.h>
using namespace std;
int n;
int a[2005];
int prob[5005];
int suffix[10010];
int main() {
  memset(a, 0, 2005 * sizeof(int));
  memset(prob, 0, 5005 * sizeof(int));
  memset(suffix, 0, 10010 * sizeof(int));
  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 = 0; j < i; j++) {
      prob[a[i] - a[j]]++;
    }
  }
  for (int i = 4999; i >= 0; i--) {
    suffix[i] = suffix[i + 1] + prob[i];
  }
  if (n == 3) {
    for (int i = 0; i < 11; i++) {
      cout << suffix[i] << " ";
    }
    cout << endl;
  }
  long double answer = 0;
  for (int i = 0; i < 5000; i++) {
    for (int j = 0; j < 5000; j++) {
      double add = 1.0 * prob[i] * prob[j] * suffix[i + j + 1];
      if (add != 0 && n == 3) {
        cout << "i,j,add = " << i << "," << j << "," << add << endl;
      }
      answer += 1.0 * prob[i] * prob[j] * suffix[i + j + 1];
    }
  }
  if (n == 3) {
    cout << "ans " << answer << endl;
  }
  long double nc2 = 1.0 * (n) * (n - 1) / 2;
  answer = 1.0 * answer / (nc2 * nc2 * nc2);
  cout << answer << endl;
  return 0;
}
