#include <bits/stdc++.h>
using namespace std;
const double eps = 0.000000000000001;
const long long int N = 6e6 + 10;
long long int f[N], suff[N];
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);
  for (i = 1; i <= n; i++)
    for (j = i + 1; j <= n; j++) f[a[j] - a[i]]++;
  for (i = a[n]; i >= 0; i--) suff[i] = f[i] + suff[i + 1];
  long long int cnt = 0;
  for (i = 0; i <= a[n]; i++) {
    for (j = 0; j <= a[n]; j++) {
      cnt += f[i] * f[j] * suff[i + j + 1];
    }
  }
  double num = (double)cnt;
  double den = (double)((n * (n - 1)) / 2);
  den = den * den * den;
  double ans = num / den;
  cout << ans << endl;
  return 0;
}
