#include <bits/stdc++.h>
using namespace std;
const long long size = 1e6 + 7;
const long long mod = 1e9 + 7;
long long arr[size];
int main() {
  cout << setprecision(12) << fixed;
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  map<long long, double> P;
  long long n;
  cin >> n;
  for (long long i = 0; i < n; i++) cin >> arr[i];
  if (n == 2) {
    cout << 0;
    return 0;
  }
  sort(arr, arr + n);
  for (long long i = 0; i < n; i++)
    for (long long j = i + 1; j < n; j++) P[arr[j] - arr[i]]++;
  double tot = n * (n - 1) / 2;
  vector<double> diff;
  vector<double> prob;
  vector<pair<double, double> > vi;
  for (auto v : P) {
    P[v.first] = v.second / tot;
    vi.push_back(make_pair(v.first, P[v.first]));
  }
  sort(vi.begin(), vi.end());
  for (auto p : vi) diff.push_back(p.first), prob.push_back(p.second);
  long long m = diff.size();
  vector<double> cum(m);
  cum[m - 1] = prob[m - 1];
  for (long long i = m - 2; i >= 0; i--) cum[i] = cum[i + 1] + prob[i];
  double ans = 0;
  for (long long i = 0; i < m; i++)
    for (long long j = 0; j < m; j++) {
      double d1 = diff[i], d2 = diff[j];
      double x = d1 + d2;
      if (x > diff[m - 1]) continue;
      long long pos = upper_bound(diff.begin(), diff.end(), x) - diff.begin();
      ans = ans + P[d1] * P[d2] * cum[pos];
    }
  cout << ans;
}
