#include <bits/stdc++.h>
using namespace std;
typedef map<int, int>::iterator iMII;
int main() {
  int n;
  while (cin >> n) {
    vector<int> v(n);
    for (int i = 0; i < n; i++) cin >> v[i];
    sort(v.begin(), v.end());
    vector<double> dif(5100);
    for (int i = 0; i < n; i++) {
      for (int j = i + 1; j < n; ++j) {
        dif[v[j] - v[i]]++;
      }
    }
    vector<double> conv(5100);
    for (int i = 0; i < 5100; i++) {
      for (int j = 0; j < 5100; j++) {
        if (i + j < 5100) conv[i + j] += dif[i] * dif[j];
      }
    }
    vector<double> menor_igual(5100);
    for (int i = 0; i < 5100; i++) {
      menor_igual[i] = (i ? menor_igual[i - 1] : 0);
      menor_igual[i] += conv[i];
    }
    double res = 0;
    vector<double> mes_gran(5100);
    for (int i = 5050 - 1; i >= 0; --i) {
      mes_gran[i] = mes_gran[i + 1] + dif[i + 1];
      res += mes_gran[i] * conv[i];
    }
    double opcions = (n * (n - 1)) / 2;
    opcions = opcions * opcions * opcions;
    cout.precision(10);
    cout << fixed << res / opcions << endl;
  }
}
