// practice with kaiboy
import java.io.*;
import java.util.*;

public class CF626D extends PrintWriter {
	CF626D() { super(System.out, true); }
	Scanner sc = new Scanner(System.in);
	public static void main(String[] $) {
		CF626D o = new CF626D(); o.main(); o.flush();
	}

	static final int A = 5000;
	void main() {
		int n = sc.nextInt();
		int[] aa = new int[n];
		for (int i = 0; i < n; i++)
			aa[i] = sc.nextInt();
		int[] kk = new int[A + 1];
		int[] qq = new int[A + 1];
		for (int i = 0; i < n; i++)
			for (int j = i + 1; j < n; j++) {
				int a = Math.abs(aa[i] - aa[j]);
				kk[a]++;
			}
		for (int q = 0, a = A; a >= 0; a--)
			qq[a] = q += kk[a];
		double p = 0;
		for (int a = 1; a <= A; a++) {
			if (kk[a] == 0)
				continue;
			for (int b = 1; b <= A; b++) {
				if (kk[b] == 0)
					continue;
				int c = a + b + 1;
				if (c > A || qq[c] == 0)
					continue;
				p += (double) kk[a] * kk[b] * qq[c];
			}
		}
		int m = n * (n - 1) / 2;
		p /= (long) m * m * m;
		println(p);
	}
}
