import java.io.PrintStream;
import java.util.Arrays;
import java.util.Scanner;

public class D {

	private static Scanner in = new Scanner(System.in);
	private static PrintStream out = System.out;
	
	public static void main(String[] args) {
		int n = in.nextInt();
		int[] a = new int[n];
		for (int i = 0; i < n; ++i)
			a[i] = in.nextInt();
		Arrays.sort(a);
		double[] p1 = new double[5000];
		for (int i = 1; i < n; ++i)
			for (int j = 0; j < i; ++j)
				p1[a[i] - a[j]] += 2.0/(n*(n - 1));
		double[] p2 = new double[10000];
		for (int i = 1; i < p1.length; ++i)
			for (int j = 1; j < p1.length; ++j)
				p2[i + j] += p1[i]*p1[j];
		double[] sum = new double[p2.length];
		for (int i = 1; i < p2.length; ++i)
			sum[i] = sum[i - 1] + p2[i];
		double ans = 0;
		for (int i = 1; i < p1.length; ++i)
			ans += p1[i]*sum[i - 1];
		out.println(ans);
	}
	
}