#include <bits/stdc++.h>
using namespace std;
double prediff[5005] = {0};
long long int diff[5005] = {0}, diffcnt[5005] = {0};
long long int a[5005];
vector<long long int> v;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  for (long long int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  for (long long int i = 1; i < n; i++) {
    for (long long int j = 0; j < i; j++) diff[a[i] - a[j]]++;
  }
  for (long long int i = 1; i <= 5000; i++)
    if (diff[i] > 0) v.push_back(i);
  for (long long int i = 1; i <= 5000; i++) {
    for (long long int j = 0; j < v.size(); j++) {
      if (v[j] < i) diffcnt[i] += diff[v[j]] * diff[i - v[j]];
    }
  }
  prediff[5000] = diff[5000];
  for (long long int i = 4999; i > 0; i--) {
    prediff[i] = prediff[i + 1] + diff[i];
  }
  long double ans = 0.0;
  for (long long int i = 1; i <= 5000; i++) {
    ans = ans + diffcnt[i] * prediff[i + 1];
  }
  long double tot = n * n * n * (n - 1) * (n - 1) * (n - 1) / 8;
  cout << fixed << setprecision(12) << (ans / tot) << endl;
}
