import java.util.Scanner;


public class CFProblemD {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner input = new Scanner(System.in);
		int n = input.nextInt();
		int[] size  = new  int[n];
		for(int a = 0; a < n; a++){
			size[a] = input.nextInt();
		}
		int[] freqDist = new int[5001];
		for(int a = 0; a < n; a++){
			for(int b = 0; b <  n; b++){
				if(a != b && size[a] > size[b]){
					freqDist[size[a]-size[b]]++;
				}
			}
		}
		//How bad are we losing  after 2 rounds?
		long[] twoRoundFreqDist = new long[20000];		
		for(int a = 0; a < freqDist.length; a++){
			for(int b = 0; b < freqDist.length; b++){
				twoRoundFreqDist[a+b] += freqDist[a]  * freqDist[b];
			}
		}
		
		//3rd Round
		double possibilities = 0;
		double total = 0;
		for(int a = 0; a < freqDist.length; a++){
			for(int b = 0; b < twoRoundFreqDist.length; b++){
				total += ((double) twoRoundFreqDist[b]) * freqDist[a];
				if(b < a){
					possibilities += ((double) twoRoundFreqDist[b]) * freqDist[a];
				}
			}
		}
		System.out.println((possibilities+0.0)/total);
	}

}
