#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  long long int ar[n + 1];
  for (long long int i = 1; i <= n; i++) cin >> ar[i];
  sort(ar + 1, ar + 1 + n, greater<long long int>());
  vector<long long int> v;
  for (long long int i = 1; i < n; i++) {
    for (long long int j = i + 1; j <= n; j++) {
      v.push_back(ar[i] - ar[j]);
    }
  }
  sort(v.begin(), v.end());
  map<long long int, long long int> m;
  for (long long int i = 0; i < v.size(); i++) {
    m[v[i]]++;
  }
  long long int ans = 0;
  long long int f[5010];
  memset(f, 0, sizeof(f));
  for (long long int i = 1; i < 5010; i++) {
    f[i] = m[i];
  }
  long long int suff[5010];
  memset(suff, 0, sizeof(suff));
  suff[5010 - 1] = f[5010 - 1];
  for (long long int i = 5010 - 2; i >= 1; i--) suff[i] = suff[i + 1] + f[i];
  for (long long int i = 1; i < 5010 - 1; i++) {
    for (long long int j = i; j < 5010; j++) {
      if (i + j >= 5010) {
        break;
      }
      long long int tmp = i + j + 1;
      ans += m[i] * m[j] * suff[tmp];
    }
  }
  double finalans;
  long long int lv = pow(((n * (n - 1)) / 2), 3);
  finalans = (1.0 * ans) / lv;
  cout << fixed << setprecision(10) << finalans << '\n';
  return 0;
}
