#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e3;
int num[maxn + 10], win[maxn + 10], fail[maxn + 10];
int main() {
  int n;
  while (scanf("%d", &n) == 1 && n) {
    for (int i = 1; i <= n; i++) scanf("%d", &num[i]);
    sort(num + 1, num + n + 1);
    int k = 0;
    for (int i = 1; i <= n; i++)
      for (int j = i + 1; j <= n; j++) {
        if (num[j] > num[i]) {
          win[k] = num[j];
          fail[k] = num[i];
          k++;
        }
      }
    int A_score, J_score, ans = 0;
    for (int i = 0; i < k; i++) {
      for (int j = 0; j < k - 1; j++) {
        if (i == j) continue;
        A_score = win[i] + win[j] + fail[j + 1];
        J_score = fail[i] + fail[j] + win[j + 1];
        if (J_score > A_score) ans++;
        A_score = win[i] + win[j + 1] + fail[j];
        J_score = fail[i] + fail[j + 1] + win[j];
        if (J_score > A_score) ans++;
      }
    }
    ans *= 2;
    for (int i = 0; i < k; i++)
      for (int j = 0; j < k; j++) {
        A_score = win[i] + win[i] + fail[j];
        J_score = fail[i] + fail[i] + win[j];
        if (J_score > A_score) {
          ans++;
        }
      }
    long long all = k * k * k;
    double possibility = (double)ans / all;
    printf("%.10f\n", possibility);
  }
  return 0;
}
