#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
inline int max(int a, int b) { return a < b ? b : a; }
inline int min(int a, int b) { return a > b ? b : a; }
inline long long max(long long a, long long b) { return a < b ? b : a; }
inline long long min(long long a, long long b) { return a > b ? b : a; }
const int mod = 1e9 + 7;
const int N = 1e6 + 10;
const long long inf = 1e18;
long long power(long long a, long long n) {
  if (n == 0) {
    return 1;
  }
  long long b = power(a, n / 2);
  b = b * b % mod;
  if (n % 2) b = b * a % mod;
  return b;
}
int add(int a, int b) { return (a + b) % mod; }
int mul(int a, int b) { return (long long)a * b % mod; }
int A[5010];
long double dp[5010], dp1[5010];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    int x;
    scanf("%d", &x);
    A[x] = 1;
  }
  for (int dif = 1; dif < 5010; ++dif) {
    for (int j = 1; j < 5001; ++j) {
      if (j + dif > 5000) break;
      if (A[j] == 1 && j + dif <= 5000 && A[j + dif] == 1) dp[dif] += 1;
    }
  }
  for (int i = 0; i < 5010; ++i)
    for (int j = 0; j < 5010; ++j) {
      if (i + j > 5000) break;
      dp1[i + j] += dp[i] * dp[j];
    }
  for (int i = 1; i < 5010; ++i) dp1[i] += dp1[i - 1];
  long long ans = 0;
  for (int dif = 1; dif < 5001; ++dif) {
    long long pans = dp[dif] * dp1[dif - 1];
    ans += pans;
  }
  long long a = n * (n - 1) / 2;
  double b = (double)a * a * a;
  printf("%.9lf\n", (double)ans / b);
  return 0;
}
