#include <bits/stdc++.h>
using namespace std;
int N;
int A[2222];
set<int> D;
map<int, int> C;
template <typename T>
class BinaryIndexedTree {
  vector<T> bit;

 public:
  BinaryIndexedTree(int n) : bit(n + 1) {}
  T sum(int i) {
    T s = 0;
    while (i > 0) {
      s += bit[i];
      i -= i & -i;
    }
    return s;
  }
  T sum(int l, int r) { return sum(r) - sum(l - 1); }
  void add(int i, T x) {
    while (i < (int)bit.size()) {
      bit[i] += x;
      i += i & -i;
    }
  }
};
BinaryIndexedTree<int> C2(10010);
int main() {
  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++) {
      int d = A[i] - A[j];
      D.insert(d);
      C[d]++;
    }
  for (auto&& w1 : D) {
    for (auto&& w2 : D) {
      C2.add(w1 + w2, C[w1] * C[w2]);
    }
  }
  long long ans = 0;
  for (auto&& w : D) {
    ans += C2.sum(w - 1);
  }
  int B = N * (N - 1) / 2;
  double x = 1.0 * ans / B / B / B;
  (void)printf("%.10f\n", x);
  return 0;
}
