#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  long long N;
  cin >> N;
  vector<int> vet(N);
  for (int i = 0; i < N; ++i) {
    cin >> vet[i];
  }
  sort((vet).rbegin(), (vet).rend());
  vector<pair<int, int> > pairs;
  for (int i = 0; i < N; ++i) {
    for (int j = i + 1; j < N; ++j) {
      pairs.push_back(make_pair(vet[i], vet[j]));
    }
  }
  sort((pairs).begin(), (pairs).end(), [](pair<int, int> a, pair<int, int> b) {
    return (2 * a.first - a.second) < (2 * b.first - b.second);
  });
  for (int i = 0; i < int((pairs).size()); ++i) {
    cout << pairs[i].first << ", " << pairs[i].second << endl;
  }
  long long den = N * (N - 1) / 2;
  den *= den * den;
  int i = 0, j = int((pairs).size()) - 1;
  long long ans = 0;
  while (i <= j) {
    pair<int, int> A = pairs[i], B = pairs[j];
    if (2 * A.first + B.second >= 2 * A.second + B.first) {
      i++;
      continue;
    }
    ans++;
    long long Andrew = A.first + B.second, Jerry = A.second + B.first;
    int lo = 0, hi = i - 1;
    while (lo < hi) {
      int mid = (lo + hi) / 2;
      pair<int, int> k = pairs[mid];
      if (Andrew + k.first < Jerry + k.second) {
        hi = mid - 1;
      } else {
        lo = mid;
      }
    }
    pair<int, int> k = pairs[lo];
    if (Andrew + k.first < Jerry + k.second)
      ans += i;
    else
      ans += lo;
    j--;
  }
  printf("%.10lf\n", (double)ans / den);
  return 0;
}
