#include <bits/stdc++.h>
using namespace std;
const int N = 100500;
int n, a[N];
int cnt[N];
long long dif[N], sum[N];
inline long long get(int i, int j) { return sum[j] - sum[i - 1]; }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
  }
  sort(a + 1, a + 1 + n);
  for (int i = 1; i <= n; ++i) {
    for (int j = i + 1; j <= n; ++j) {
      cnt[a[j] - a[i]]++;
    }
  }
  for (int i = 1; i <= 5000; ++i) {
    for (int j = 1; j <= 5000; ++j) {
      dif[i + j] += (long long)cnt[i] * (long long)cnt[j];
    }
  }
  for (int i = 1; i <= 20000; ++i) sum[i] = sum[i - 1] + dif[i];
  double ans = 0;
  for (int i = 1; i <= 5000; ++i) {
    ans += (long long)cnt[i] * sum[i - 1];
  }
  long long pairs = n * (n - 1) / 2;
  ans /= pairs;
  ans /= pairs;
  ans /= pairs;
  printf("%.10f\n", ans);
  return 0;
}
