import java.io.*;
import java.util.*;
import java.math.*;

public class VC2016_Elimination_D {
	public static void main(String[] args) throws IOException {
		//InputStream is = new FileInputStream("D.in");
		//OutputStream os = new FileOutputStream("D-mysol.txt");
		InputStream is = new BufferedInputStream(System.in);
		OutputStream os = System.out;
		Scanner sc = new Scanner(is);
		PrintWriter out = new PrintWriter(os);
		while(sc.hasNextInt()) {
			int n = sc.nextInt();
			int [] nums = new int[n];
			int maxi = 0;
			for(int i = 0;i < nums.length;i++) {
				nums[i] = sc.nextInt();
				maxi = Math.max(maxi, nums[i]);
			}
			long [] diff = new long[maxi+1];
			long total = 0;
			for(int i = 0;i < nums.length;i++)
				for(int j = 0;j < nums.length;j++) {
					if(nums[i] > nums[j]) {
						total++;
						int difference = nums[i]-nums[j];
						diff[difference]++;
					}
				}
			long [] commDiff = new long[maxi+1];
			commDiff[commDiff.length-1] = diff[diff.length-1];
			for(int i = commDiff.length-2;i >= 0;i--)
				commDiff[i] = diff[i] + commDiff[i+1];
			double res = 0;
			for(int i = 0;i < diff.length;i++) {
				for(int j = 0;j < diff.length;j++) {
					if(diff[i] > 0 && diff[j] > 0) {
						int newDiff = i+j;
						long freq = diff[i]*diff[j];
						long newTotal = total*total;
						double prob = freq*1.0/newTotal;
						if(newDiff+1 < commDiff.length)
							res += prob*commDiff[newDiff+1]/total;
					}
				}
			}
			out.printf("%.9f\n", res);
		}
		out.close();
	}
}