#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100500;
const int SZ = 5000;
int n;
long long arr[MAXN];
long long cnt[MAXN];
long long suf[MAXN];
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> arr[i];
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < i; ++j) cnt[abs(arr[i] - arr[j])] += 1;
  for (int i = 0; i < SZ; ++i) suf[SZ - i - 1] = suf[SZ - i] + cnt[SZ - i - 1];
  long long res = 0;
  for (int i = 0; i < SZ; ++i)
    for (int j = 0; j < SZ; ++j) {
      res += 8 * cnt[i] * suf[i + j + 1] * cnt[j];
    }
  cout.precision(20);
  long long u = n * (n - 1);
  u = u * u * u;
  cout << (double)res / (double)u;
  return 0;
}
