#include <bits/stdc++.h>
using namespace std;
double dp[5010];
double d[10010];
int a[10001];
vector<int> v;
int main() {
  int n, i, j;
  cin >> n;
  for (i = 1; i <= n; i++) cin >> a[i];
  int aaa = 0, bbb = 0;
  for (i = 1; i <= n; i++)
    for (j = 1; j <= n; j++) {
      if (a[i] > a[j]) {
        aaa++;
        dp[a[i] - a[j]]++;
      } else if (a[j] > a[i]) {
        bbb++;
        v.push_back(a[j] - a[i]);
      }
    }
  for (i = 2; i <= 5000; i++)
    for (j = 1; j < i; j++) d[i] += dp[i - j] * dp[j];
  sort(v.begin(), v.end());
  double ans = 0;
  j = 0;
  for (i = 2; i <= 5000; i++) {
    while (j < v.size() && v[j] <= i) j++;
    ans += d[i] * (v.size() - j);
  }
  printf("%.10f", ans / (1. * aaa * aaa * bbb));
  return 0;
}
