#include <bits/stdc++.h>
using namespace std;
const int N = 5000;
int a[N], b[N + 4], s[N + 4], n;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++)
      ++b[((a[j] - a[i]) > 0 ? (a[j] - a[i]) : -(a[j] - a[i]))];
  for (int i = N; i > 0; i--) s[i] = s[i + 1] + b[i];
  double ans = 0;
  for (int i = 1; i <= N; i++)
    for (int j = 1; i + j <= N; j++) {
      ans += 1.0 * b[i] * b[j] * s[i + j + 1];
    }
  for (int i = 0; i < 3; i++) ans /= n * (n - 1) / 2;
  printf("%.10f\n", ans);
}
