#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-8;
const int mod = 1e9 + 7;
const int N = 1e6 + 10;
const long long INF = 1e18;
long long power(long long x, long long y) {
  long long t = 1;
  while (y > 0) {
    if (y % 2)
      y -= 1, t = t * x % mod;
    else
      y /= 2, x = x * x % mod;
  }
  return t;
}
int arr[5055];
long long dp[5055], dp2[5055];
int main() {
  int n;
  scanf("%d", &n);
  int c = 5002;
  for (int i = 0; i < n; ++i) scanf("%d", &arr[i]);
  sort(arr, arr + n);
  for (int i = 0; i < n; ++i)
    for (int j = i + 1; j < n; ++j) dp[arr[j] - arr[i]]++;
  for (int i = 0; i < c; ++i)
    for (int j = 0; j < c; ++j) {
      if (i + j < c) dp2[i + j] += dp[i] * dp[j];
    }
  long double ans = 0;
  for (int i = 1; i < c; i++) dp2[i] += dp2[i - 1];
  for (int i = 1; i < c + 1; ++i) {
    ans += dp2[i - 1] * dp[i];
  }
  ans *= 8;
  ans /= n;
  ans /= n;
  ans /= n;
  n--;
  ans /= n;
  ans /= n;
  ans /= n;
  printf("%.9lf\n", (double)ans);
  return 0;
}
