#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int MAX = 5005;
int arr[2005];
int diff[MAX];
int suff[3 * MAX];
int main() {
  int x;
  scanf("%d", &x);
  for (int i = 0; i < x; i++) {
    scanf("%d", &arr[i]);
  };
  sort(arr, arr + x);
  for (int i = 0; i < x; i++) {
    for (int j = i + 1; j < x; j++) {
      diff[arr[j] - arr[i]]++;
    }
  }
  suff[5000] = 0;
  for (int i = 4999; i >= 1; i--) {
    suff[i] = suff[i + 1] + diff[i];
  }
  long long tot = 0;
  for (int i = 0; i < MAX; i++) {
    for (int j = 0; j < MAX; j++) {
      tot +=
          (long long)diff[i] * (long long)diff[j] * (long long)suff[i + j + 1];
    }
  }
  long long xx = x * (x - 1) / 2;
  long long comb = xx * xx * xx;
  cout << fixed << setprecision(10) << tot / (comb + 0.0) << endl;
}
