#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int *a = (int *)malloc(n * sizeof(int));
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  long long *diff = (long long *)calloc(5000, sizeof(long long));
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++) diff[abs(a[i] - a[j])]++;
  long long *sumdiff = (long long *)calloc(10000, sizeof(long long));
  for (int i = 0; i < 5000; i++)
    for (int j = 0; j < 5000; j++) sumdiff[i + j] += diff[i] * diff[j];
  for (int i = 1; i < 10000; i++) sumdiff[i] += sumdiff[i - 1];
  long long num = 0;
  for (int i = 1; i < 5000; i++) num += diff[i] * sumdiff[i - 1];
  long double den = 1;
  long long nc2 = n * (n - 1) / 2;
  den *= nc2;
  den *= nc2;
  den *= nc2;
  long double ans = num / den;
  cout << setprecision(12) << ans << endl;
  return 0;
}
