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

public class D_faster { 

	static int MAX_NUM = 5005;

	public static void main(String [] args) throws IOException { 

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer tokenizer;

		int N = Integer.parseInt(br.readLine());
		
		tokenizer = new StringTokenizer(br.readLine());

		int [] arr = new int[N];

		for(int i=0; i<N; i++) { 
			arr[i] = Integer.parseInt(tokenizer.nextToken());
		}

		Arrays.sort(arr);
		
		long [] diff = new long[MAX_NUM];
		
		for(int i=0; i<N; i++) { 
			for(int j=i+1; j<N; j++) { 
				diff[arr[j] - arr[i]]++;
			}
		}

		long [] sumDiff = new long[ 2 * MAX_NUM];

		for(int firstDiff = 0; firstDiff < MAX_NUM; firstDiff++) 
			for(int secDiff=0; secDiff < MAX_NUM; secDiff++)
				sumDiff[firstDiff+secDiff] += diff[firstDiff] * diff[secDiff];

		long [] suffix_sums = new long[1 + MAX_NUM];
		suffix_sums[MAX_NUM-1] = diff[MAX_NUM-1];

for(int i=MAX_NUM-2; i>=0; i--) 
suffix_sums[i] = suffix_sums[i+1] + diff[i];

		long total = 0;
for(int i=0; i<MAX_NUM-1; i++)
			total += suffix_sums[i+1] * sumDiff[i];
		
		double nom = total;
		double den = 1.0;
	
		for(int i=0; i<3; i++) { 
			den *= (N*(N-1) / 2.0);
		}
		
		System.out.println(nom/den);
		
	}
}