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

public class D {
	
	// maximum number that an element in an array can receive
	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());
		}
		// sort the array to find the differences between the winner and the loser
		// more easily
		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)
		
		// sumDiff[i] - number of outcomes such that after two rounds Andrew leads by 'i' points
		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;
			
			
			// if Andrew leads by 'i' points, let's count how many ways are there
			// such that Jerry wins with a difference by more than 'i' points
			int howManyGreater = 0;
			
			for(int j=1+i; j<MAX_NUM; j++) { 
				howManyGreater += diff[j];
			}
			
			
			// number of ways Jerry can score a difference greater than i in the third round
			// * 
			// number of ways Andrew can score a total difference of 'i', after two rounds
			total += howManyGreater * sumDiff[i];
		}
		
		double nom = total;
		double denom = 1;
		
		
		// There are (N*(N-1) / 2)^3 possible outcomes
		// because in each of the three (^3) rounds we have N*(N-1) possible outcomes
		// and we assume that the drawings in each round are independent
		
		for(int i=0; i<3; i++) { 
			denom *= (N * (N-1))/2.0;
		}
		
		System.out.println(nom/denom);
	}

}
