#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
int a[N];
long long ans, num[N], num2[N], sum;
int n;
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 = 1; j < i; j++) num[a[i] - a[j]]++;
  for (int i = 1; i <= 5000; i++)
    for (int j = 1; j <= 5000; j++) num2[i + j] += num[i] * num[j];
  for (int i = 1; i <= 10000; i++) num2[i] += num2[i - 1];
  for (int i = 1; i <= n; i++)
    for (int j = 1; j < i; j++)
      if (a[i] > a[j]) {
        int k = a[i] - a[j];
        ans += num2[k - 1];
        sum++;
      }
  sum = sum * sum * sum;
  printf("%.10f\n", 1.00 * ans / sum);
  return 0;
}
