import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class D {

	static int MAX_NUM = 5005;
	public static void main(String [] args) throws IOException {		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		
		int N = Integer.parseInt(br.readLine());
		StringTokenizer tokenizer = new StringTokenizer(br.readLine());
		
		int [] a = new int[N];
		
		
		for(int i=0; i<N; i++) { 
			a[i] = Integer.parseInt(tokenizer.nextToken());
		}
		
		Arrays.sort(a);
		
		
		// diff[i] - how many times difference of 'i' units occurs when the points of the loser
		// are substracted from the points of the winner
		long [] diff = new long[MAX_NUM];
		
		for(int i=0; i<N; i++) 
			for(int j=i+1; j<N; j++)
				diff[a[j] - a[i]]++;
		
		
		// this array will represent the sum of differences in the first two rounds
		// sumDiff[i] - how many ways to get to sum of 'i' units (advantage of Andrew over Jerry)
		long [] sumDiff = new long[2*MAX_NUM];
		
		
		for(int i=0; i<MAX_NUM; i++) 
			for(int j=0; j<MAX_NUM; j++) 
				sumDiff[i + j] += diff[i] * diff[j];
		
		
		long total = 0; 
		
		for(int i=0; i<MAX_NUM-1; i++) {
			
			if(sumDiff[i] == 0) continue;
			
			int howManyGreater = 0;
			
			for(int j=1+i; j<MAX_NUM; j++) { 
				howManyGreater += diff[j];
			}
			
			total += howManyGreater * sumDiff[i];
		}
		
		double nom = total;
		double denom = 1;
		
		for(int i=0; i<3; i++) { 
			
			denom *= (N * (N-1))/2.0;
		}
		
		System.out.println(nom/denom);
	}

}