#include <bits/stdc++.h>
using namespace std;
const int N = 2010;
int n, a[N];
double pos[2][10010], sum[10010], ans;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= (n); i++) scanf("%d", &a[i]);
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= (n); i++)
    for (int j = 1; j <= (i - 1); j++)
      pos[0][a[i] - a[j]] = 1.0 / (n * (n - 1) / 2);
  for (int i = 1; i <= (a[n] - a[1]); i++)
    if (pos[0][i] > 0)
      for (int j = 1; j <= (a[n] - a[1]); j++)
        if (pos[0][j] > 0) pos[1][i + j] += pos[0][i] * pos[0][j];
  for (int i = 1; i <= (2 * (a[n] - a[1])); i++)
    sum[i] = sum[i - 1] + pos[1][i];
  for (int i = 1; i <= (n); i++)
    for (int j = 1; j <= (i - 1); j++)
      ans += sum[a[i] - a[j] - 1] * 1.0 / (n * (n - 1) / 2);
  printf("%.7lf\n", ans);
  return 0;
}
