#include <bits/stdc++.h>
using namespace std;
template <typename T>
T nextInt() {
  T x = 0, p = 1;
  char ch;
  do {
    ch = getchar();
  } while (ch <= ' ');
  if (ch == '-') {
    p = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + (ch - '0');
    ch = getchar();
  }
  return x * p;
}
const int maxN = 4e6;
const int INF = (int)1e9;
const int mod = (int)1e9 + 7;
const long long LLINF = (long long)1e18;
const long double pi = acos(-1.0);
int a[maxN];
int b[maxN];
int s[maxN];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> s[i];
  }
  int szA = 0, szB = 0;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (s[i] > s[j]) {
        a[szA++] = s[i] - s[j];
      } else if (s[i] < s[j]) {
        b[szB++] = s[j] - s[i];
      }
    }
  }
  sort(a, a + szA);
  sort(b, b + szB);
  long long res = 0LL;
  int ptrA = 0, ptrB = 0;
  for (int i = 0; i < szB; ++i) {
    while (ptrA < szA && a[ptrA] < b[i]) {
      res += ptrA * ptrB;
      while (ptrB <= ptrA && a[ptrA] + a[ptrB] < b[i]) {
        ptrB++;
        res += ptrA * ptrB;
      }
      ++ptrA;
    }
  }
  long double result = 2 * res / 1.0 / szA / szA / szB;
  cout.precision(12);
  cout << result << '\n';
  return 0;
}
