#include <bits/stdc++.h>
using namespace std;
int a[(int)(2e5 + 10)], dp[(int)(2e5 + 10)], n, m;
double ans, dp2[(int)(2e5 + 10)];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++) dp[abs(a[i] - a[j])]++;
  m = (n - 1) * n / 2;
  for (int i = 1; i <= 5000; i++)
    for (int j = 1; j <= 5000; j++) dp2[i + j] += 1.0 * dp[i] / m * dp[j] / m;
  for (int i = 1; i <= 5100; i++) dp2[i] += dp2[i - 1];
  for (int i = 1; i <= 5100; i++) ans += 1.0 * dp2[i - 1] * dp[i] / m;
  printf("%.12lf\n", ans);
}
