#include <bits/stdc++.h>
using namespace std;
double diffprob[5010], ssum[5010];
int balls[5010], N;
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cin >> N;
  for (int i = 0; i < N; ++i) {
    cin >> balls[i];
    for (int j = i - 1; j >= 0; --j) {
      diffprob[abs(balls[i] - balls[j])] += (double)2 / N / (N - 1);
    }
  }
  for (int i = 5000; i >= 0; --i) {
    ssum[i] = ssum[i + 1] + diffprob[i];
  }
  double ans = 0;
  for (int i = 0; i <= 5000; ++i) {
    for (int j = 0; i + j <= 5000; ++j) {
      ans += diffprob[i] * diffprob[j] * ssum[i + j + 1];
    }
  }
  printf("%.9f", ans);
  return 0;
}
