#include <bits/stdc++.h>
using namespace std;
int a[5000005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<int> w, v, rv;
  for (int i = 0; i < n; i++) {
    int t;
    cin >> t;
    w.push_back(t);
  }
  for (int i = 0; i < n - 1; i++)
    for (int j = i + 1; j < n; j++) v.push_back(abs(w[i] - w[j]));
  for (int i = 0; i < v.size(); i++) rv.push_back(10000 - v[i]);
  sort(v.begin(), v.end());
  sort(rv.begin(), rv.end());
  long long ans = 0;
  a[0] = 0;
  for (int i = 1; i < v.size(); i++) {
    int x = v.size() -
            (upper_bound(rv.begin(), rv.end(), 10000 - (a[i] - a[i - 1])) -
             rv.begin());
    a[i] = x + a[i - 1];
    if (v[i] > v[i - 1] * 2) a[i]++;
    ans += a[i];
  }
  long double q = ans;
  long double y = v.size();
  long double e = q / y;
  long double r = e / y;
  long double t = r / y;
  cout.precision(20);
  cout << t << endl;
  return 0;
}
