#include <bits/stdc++.h>
using namespace std;
long long int dp[1000005];
long long int suf[1000005];
long long int a[1000005];
int main() {
  long long int n;
  scanf("%lld", &n);
  for (long long int i = 1; i <= (long long int)n; i++) scanf("%lld", a + i);
  for (long long int i = 1; i <= (long long int)n; i++)
    for (long long int j = i + 1; j <= (long long int)n; j++)
      dp[abs(a[i] - a[j])]++;
  for (long long int i = 1000005 - 2; i >= (long long int)0; i--)
    suf[i] = dp[i] + suf[i + 1];
  double di = (n * (n - 1)) / 2;
  double ans = 0;
  for (long long int i = 1; i <= (long long int)5005; i++) {
    if (!dp[i]) continue;
    for (long long int j = 1; j <= (long long int)5005; j++) {
      if (!dp[j]) continue;
      double add = (double)dp[i] / di;
      add *= (double)dp[j] / di;
      add *= (double)suf[i + j + 1] / di;
      ans = ans + add;
    }
  }
  printf("%.10f", ans);
  return 0;
}
