#include <bits/stdc++.h>
using namespace std;
const int inf = ~0U >> 1;
const long long INF = ~0ULL >> 1;
const long double pi = acos(-1.0);
template <class T>
inline void read(T &n) {
  char c;
  int flag = 1;
  for (c = getchar(); !(c >= '0' && c <= '9' || c == '-'); c = getchar())
    ;
  if (c == '-')
    flag = -1, n = 0;
  else
    n = c - '0';
  for (c = getchar(); c >= '0' && c <= '9'; c = getchar()) n = n * 10 + c - '0';
  n *= flag;
}
const int maxn = 500000;
struct Complex {
  long double x, y;
  Complex() {}
  Complex(double _x, double _y) : x(_x), y(_y) {}
};
inline Complex operator+(const Complex &A, const Complex &B) {
  return Complex(A.x + B.x, A.y + B.y);
}
inline Complex operator-(const Complex &A, const Complex &B) {
  return Complex(A.x - B.x, A.y - B.y);
}
inline Complex operator*(const Complex &A, const Complex &B) {
  return Complex(A.x * B.x - A.y * B.y, A.x * B.y + A.y * B.x);
}
struct FFT {
  int n, N, id[maxn], Index;
  Complex a[maxn], b[maxn];
  void reset(int _n = 0) {
    if (!_n) {
      for (n = 1; n < N; n <<= 1)
        ;
      n <<= 1;
    } else
      n = _n;
  }
  void getid(int s, int d) {
    if (n >> d == 1) {
      id[Index++] = s;
      return;
    }
    getid(s, d + 1);
    getid(s + (1 << d), d + 1);
  }
  void fft(int v) {
    Index = 0;
    getid(0, 0);
    for (int i = (0); i < (n); ++i) b[i] = a[i];
    for (int i = (0); i < (n); ++i) a[i] = b[id[i]];
    for (int d = 2; d <= n; d <<= 1) {
      Complex wn(cos(-2 * pi / d), sin(-2 * v * pi / d));
      for (int i = 0; i < n; i += d) {
        Complex w(1, 0);
        for (int k = i; k < i + (d >> 1); ++k) {
          Complex u = a[k];
          Complex v = w * a[k + (d >> 1)];
          a[k] = u + v;
          a[k + (d >> 1)] = u - v;
          w = w * wn;
        }
      }
    }
    if (v < 0)
      for (int i = (0); i < (n); ++i) a[i].x /= n;
  }
} A, B, C;
long long ans = 0;
int cnt[maxn], N, M, a[maxn];
int main(int argc, char *argv[]) {
  scanf("%d", &N);
  for (int i = (1); i <= (N); ++i) scanf("%d", &a[i]);
  A.N = 12000;
  B.N = 12000;
  A.reset();
  B.reset();
  for (int i = (1); i <= (N); ++i)
    for (int j = (1); j <= (N); ++j)
      if (i != j && a[i] > a[j])
        ++A.a[a[i] - a[j]].x, ++B.a[a[i] - a[j]].x, ++M, ++cnt[a[i] - a[j]];
  A.fft(1);
  B.fft(1);
  for (int i = (0); i < (A.n); ++i) A.a[i] = A.a[i] * B.a[i];
  A.fft(-1);
  long long sum = 0;
  for (int i = (0); i < (A.n); ++i) {
    ans += sum * cnt[i];
    sum += (long long)(A.a[i].x + 0.5);
  }
  cout << fixed << setprecision(15) << (long double)ans / M / M / M << endl;
  return 0;
}
