#include <bits/stdc++.h>
using namespace std;
const int OO = (int)2e9;
const int MOD = (int)1e9 + 7;
const long double Pi = 3.1415926535897932384;
const int N = (int)5e3 + 5;
int a[N], cnt[N], n;
long long dp[N], res = 0;
int main() {
  cin >> n;
  for (int i = (int)(1); i <= (int)(n); i++) cin >> a[i];
  for (int i = (int)(1); i <= (int)(n - 1); i++)
    for (int j = (int)(i + 1); j <= (int)(n); j++) cnt[abs(a[i] - a[j])]++;
  for (int i = (int)(1); i <= (int)(N - 1); i++)
    for (int j = (int)(1); j <= (int)(N - 1 - i); j++)
      dp[i + j] += 1LL * cnt[i] * cnt[j];
  for (int i = (int)(1); i <= (int)(N - 1); i++)
    for (int j = (int)(1); j <= (int)(i - 1); j++) res += 1LL * cnt[i] * dp[j];
  printf("%.7lf",
         1.0 * res / (n * (n - 1) / 2) / (n * (n - 1) / 2) / (n * (n - 1) / 2));
}
