import java.io.*;
import java.util.*;

public class d1 {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		int n = in.nextInt();

		int a[] = new int[n];

		for (int i = 0; i < n; i++) {
			a[i] = in.nextInt();
		}

		int cnt[] = new int[10001];

		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				if (i != j) {
					cnt[a[i] - a[j] + 5000]++;
				}
			}
		}

		long bigger[] = new long[10001];
		long last = 0;

		for (int i = 10000; i >= 0; i--) {
			bigger[i] = last;
			last += cnt[i];
		}

		long ans = 0;
		// System.err.println(Long.MAX_VALUE);

		for (int i = 0; i < 5000; i++) {
			for (int j = i; j < 5000; j++) {
				if (Math.abs(i - 5000) + Math.abs(j - 5000) + 5000 <= 10000) {
					ans += 1l * bigger[Math.abs(i - 5000) + Math.abs(j - 5000) + 5000] * cnt[i] * cnt[j];
					/*if (1l * bigger[Math.abs(i - 5000) + Math.abs(j - 5000) + 5000] * cnt[i] * cnt[j] > 0){
						out.println(i + " " + j + " " + bigger[Math.abs(i - 5000) + Math.abs(j - 5000) + 5000] + " " + (Math.abs(i - 5000) + Math.abs(j - 5000) + 5000));
					}*/
				}
			}
		}

		long chose = 1l * n * (n - 1) / 2;
		chose = 1l * chose * chose * chose;
		out.println(1d * ans / chose);
		out.close();
	}
}
