#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
long long n, balls[5000], a[5000], b[10000], ans = 0;
double ans1;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &balls[i]);
  sort(balls, balls + n);
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++) a[balls[j] - balls[i]]++;
  for (int i = 0; i < 5000; i++)
    for (int j = 0; j < 5000; j++) b[i + j] += a[i] * a[j];
  for (int i = 0; i < 5000; i++)
    for (int j = 0; j < i; j++) ans += a[i] * b[j];
  long long kk = n * (n - 1) / 2;
  long long k = kk * kk * kk;
  ans1 = double(ans) / double(k);
  cout << fixed << setprecision(10) << ans1;
  return 0;
}
