import java.util.*;
import java.io.*;
public class Main {
public static void main(String [] args)throws Exception{
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	int n = Integer.parseInt(br.readLine());
	StringTokenizer st = new StringTokenizer(br.readLine());
	int array[] = new int[n + 1];
	for(int i = 1;i <= n;i++)
		array[i] = Integer.parseInt(st.nextToken());
	
	int diff[] = new int[5005];
	for(int i = 1;i <= n;i++){
		for(int j = i;j <= n;j++){
			if(i == j)continue;
			diff[Math.abs(array[i] - array[j])]++;
		}
	}
	int cum[] = new int[5005];
	for(int i = 1;i < cum.length;i++){
		cum[i] = cum[i - 1] + diff[i];
	}
	double ans = 0;
	double t = n*(n - 1)/2.0;
	for(int i = 1;i < 5005;i++){
		for(int j = 1;j < 5005;j++){
			if(diff[i] == 0 || diff[j] == 0)continue;
			if(i + j > 5000)continue;
			long poss = cum[5004] - cum[i + j];
			//System.out.println((i + j) + " " + cum[5004] + " " + cum[i + j]);
			ans += (poss/t)*(diff[i]/t)*(diff[j]/t);
		}
	}
	System.out.print(ans);	
}
}