#include <bits/stdc++.h>
using namespace std;
int a[2002], cnt[5000], rnt[10003];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      cnt[a[j] - a[i]]++;
    }
  }
  int ans = 0;
  for (int i = 10000; i >= 0; i--) rnt[i] = rnt[i + 1] + cnt[i];
  for (int i = 1; i < 5000; i++) {
    for (int j = 1; j < 5000; j++) {
      ans += cnt[i] * cnt[j] * rnt[i + j + 1];
    }
  }
  double deno = n * (n - 1) / 2;
  double res = (((ans / deno) / deno) / deno);
  cout << setprecision(9);
  cout << fixed;
  cout << res << endl;
}
