#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5555, MOD = 1e9 + 7;
int a[MAXN] = {}, used[MAXN] = {};
vector<int> v;
int ans = 0;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int q = n * (n - 1) / 2;
  q = q * q * q;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    for (int j = 0; j < i; j++) used[abs(a[j] - a[i])]++;
  }
  for (int i = 1; i < 5000; i++) {
    if (!used[i]) continue;
    for (int j = 1; j < i; j++) ans += used[j] * used[i - j] * used[i];
  }
  cout << setprecision(10) << (long double)ans / q;
}
