import java.util.Arrays;
import java.util.Scanner;

public class d8vc {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int numbs[] = new int[n];
		for(int i = 0; i < n; i++)
			numbs[i] = in.nextInt();
		Arrays.sort(numbs);
		int ways1[] = new int[5000];
		for(int i = 0; i < n; i++) {
			for(int j = i-1 ; j >= 0; j--) {
				ways1[numbs[i] - numbs[j]]++;
			}
		}
		long tot1 = 0;
		for(int i = 0; i < 5000; i++) {
			tot1 += ways1[i];
		}
		int ways2[] = new int[10000];
		for(int i = 0; i < 5000; i++) {
			for(int j = 0; j < 5000; j++) {
				ways2[i+j]+= ways1[i] * ways1[j];
			}
		}
//		for(int i = 0; i < 10; i++) {
//			System.out.print(ways2[i] + " ");
//		}System.out.println();
//		
		long tot2 = 0;
		for(int i = 0 ;i < 10000;i++)
			tot2 += ways2[i];
		
		double prob = 0;
		double pre = 0;
		for(int i = 0; i < 5000; i++) {
			prob += (double)ways1[i] / tot1 * pre/tot2;
			pre += ways2[i];
		}
		
		System.out.println(prob);
	}
}
