#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  cin.sync_with_stdio(0);
  int n;
  cin >> n;
  int a[n];
  map<int, int> cnt_;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      cnt_[abs(a[i] - a[j])]++;
    }
  }
  vector<pair<int, int>> v;
  for (auto it : cnt_) {
    for (auto itt : cnt_) {
      int f1 = it.first;
      int f2 = itt.first;
      v.push_back({f1 + f2, cnt_[f1] * cnt_[f2]});
    }
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < v.size(); i++) {
    v[i].second += (i ? v[i - 1].second : 0);
  }
  long long ans = 0;
  long long total = (n * (n - 1)) / 2;
  total *= total * total;
  for (auto it : cnt_) {
    int f = it.first;
    int s = it.second;
    int pos = -1;
    int L = 0, R = v.size() - 1;
    while (L <= R) {
      int mid = (L + R) / 2;
      if (v[mid].first < f) {
        pos = mid;
        L = mid + 1;
      } else {
        R = mid - 1;
      }
    }
    if (pos != -1) {
      ans += 1ll * s * v[pos].second;
    }
  }
  cout << fixed << setprecision(10);
  cout << 1.0 * ans / total;
}
