#include <bits/stdc++.h>
using namespace std;
int vals[2005];
long long choices[11000], prefix[11000];
long long diff[11000];
int abs(int k) { return (k < 0) ? -k : k; }
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> vals[i];
  set<int> all;
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      diff[abs(vals[i] - vals[j])]++;
      all.insert(abs(vals[i] - vals[j]));
    }
  }
  for (set<int>::iterator it = all.begin(); it != all.end(); ++it) {
    int cur = *it;
    choices[2 * cur] += diff[cur];
    long long nc2 = (diff[cur]) * (diff[cur] - 1);
    choices[2 * cur] += nc2;
    for (set<int>::iterator jt = all.begin(); jt != it; ++jt) {
      choices[cur + *jt] += 2 * diff[cur] * diff[*jt];
    }
  }
  double success = 0;
  long long sum = 0;
  for (int i = 0; i < 10500; ++i) {
    sum += choices[i];
    success += sum * diff[i + 1];
  }
  double nc2 = n * (n - 1) / 2;
  printf("%.9f\n", success / (nc2 * nc2 * nc2));
}
