#include <bits/stdc++.h>
using namespace std;
long long int a[5005], diff[5005], sum[5005];
int main() {
  ios::sync_with_stdio(false);
  ;
  cin.tie(0);
  ;
  long long int i, j, n, temp = 0;
  double ans = 0.0;
  cout << fixed << setprecision(10);
  cin >> n;
  for (i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  for (i = 1; i <= n; i++) {
    for (j = 1; j < i; j++) diff[a[i] - a[j]]++;
  }
  for (i = 1; i <= 5000; i++) {
    for (j = 1; j <= 5000; j++) sum[i + j] += diff[i] * diff[j];
  }
  for (i = 1; i <= 5000; i++) {
    temp = 0;
    for (j = 0; j < i; j++) temp += sum[j];
    ans += 1.0 * temp * diff[i];
  }
  ans *= 1.0 * 8;
  ans = 1.0 * ans / (n * n * n);
  ans = 1.0 * ans / ((n - 1) * (n - 1) * (n - 1));
  cout << ans;
  return 0;
}
