#include <bits/stdc++.h>
using namespace std;
int n;
const int MAXN = 2010;
int a[MAXN];
const int MAXA = 5010;
long long num1[MAXA], sum1[MAXA], num2[2 * MAXA];
long double res;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < (int)(n); i++) scanf("%d", &a[i]);
  sort(a, a + n);
  memset(num1, 0, sizeof num1);
  memset(sum1, 0, sizeof sum1);
  memset(num2, 0, sizeof num2);
  long long den1 = 1LL * n * (n - 1) / 2;
  long long den2 = 1LL * den1 * den1;
  for (int i = 0; i < (int)(n); i++) {
    for (int j = i + 1; j < n; j++) {
      num1[a[j] - a[i]] += 1;
    }
  }
  sum1[MAXA - 1] = 0;
  for (int i = MAXA - 2; i >= 0; i--) {
    sum1[i] = sum1[i + 1] + num1[i + 1];
  }
  res = 0.0;
  for (int i = 0; i < (int)(MAXA); i++) {
    for (int j = 1; j < i; j++) {
      num2[i] += num1[j] * num1[i - j];
    }
    res += (1.0 * num2[i] / den2) * (1.0 * sum1[i] / den1);
  }
  cout << setprecision(12) << res << endl;
  return 0;
}
