#include <bits/stdc++.h>
using namespace std;
inline void pisz(int n) { printf("%d\n", n); }
template <typename T, typename TT>
ostream& operator<<(ostream& s, pair<T, TT> t) {
  return s << "(" << t.first << "," << t.second << ")";
}
template <typename T>
ostream& operator<<(ostream& s, vector<T> t) {
  for (int(i) = 0; (i) < (((int)((t).size()))); ++(i)) s << t[i] << " ";
  return s;
}
const int M = 40008;
int cnt[M + M], a[M];
long double dp1[M + M], dp2[M + M], dp3[M + M];
int main() {
  int(n);
  scanf("%d", &(n));
  ;
  for (int(i) = 1; (i) <= (n); ++(i)) {
    scanf("%d", a + i);
  }
  int neg = 0, pos = 0;
  for (int(i) = 1; (i) <= (n); ++(i))
    for (int(j) = 1; (j) <= (n); ++(j))
      if (i != j) {
        int s = a[i] - a[j];
        if (s < 0)
          ++neg;
        else
          ++pos;
        cnt[M + s]++;
      }
  for (int(k) = (-5000); (k) <= (0); ++k) {
    dp1[M + k] = cnt[M + k] * 1.0L / neg;
  }
  for (int(k) = (-5000); (k) <= (0); ++k) {
    for (int(l) = (-5000); (l) <= (0); ++l) {
      dp2[M + k + l] += dp1[M + k] * dp1[M + l];
    }
  }
  long double res = 0;
  for (int(k) = (-5000); (k) <= (0); ++k) {
    for (int(l) = (-k + 1); (l) <= (5000); ++l) {
      res += dp2[M + k] * (cnt[M + l] * 1.0L / pos);
    }
  }
  cout << setprecision(13) << fixed << double(res);
}
