#include <bits/stdc++.h>
using namespace std;
const double eps = 0.000000000000001;
const long long int N = 6e6 + 10;
long long int diff[N], p;
long long int bs(long long int num) {
  if (num > diff[p]) return -1;
  long long int low = 1, high = p, mid;
  while (low < high) {
    mid = (low + high) / 2;
    if (diff[mid] <= num)
      low = mid + 1;
    else
      high = mid;
  }
  return low;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout << fixed;
  long long int n, i, a[10000], j, x;
  cin >> n;
  for (i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  p = 0;
  for (i = 1; i <= n; i++) {
    for (j = i + 1; j <= n; j++) {
      x = a[j] - a[i];
      p++;
      diff[p] = x;
    }
  }
  sort(diff + 1, diff + p + 1);
  long long int cnt = 0;
  for (i = 1; i <= p; i++) {
    long long int s = bs(2 * diff[i]);
    if (s == -1) continue;
    cnt += (p - s + 1) * (s - 1) * (s - 1);
  }
  double num = (double)cnt;
  double ans = (double)(cnt) / (double)(p * p * p);
  cout << ans << endl;
  return 0;
}
