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

public class D {
    public static void main(String[] args) throws IOException {
	BufferedReader in =
	    new BufferedReader(new InputStreamReader(System.in));
	int n = Integer.parseInt(in.readLine());
	int[] balls = new int[n];
	String[] line = in.readLine().split(" ");
	int maxa = 0;
	for (int i = 0; i < n; i++) {
	    balls[i] = Integer.parseInt(line[i]);
	    maxa = Math.max(maxa, balls[i]);
	}
	long[] diffs = new long[maxa];
	for (int i = 0; i < n; i++) {
	    int bi = balls[i];
	    for (int j = i+1; j < n; j++) {
		diffs[Math.abs(bi-balls[j])]++;
	    }
	}
	long[] sumdiffs = new long[2*maxa];
	for (int i = 0; i < maxa; i++) {
	    for (int j = 0; j < maxa; j++) {
		sumdiffs[i+j] += diffs[i]*diffs[j];
	    }
	}
	long[] diffgt = new long[2*maxa];
	long running = 0;
	for (int i = maxa-1; i >= 0; i--) {
	    diffgt[i] = running;
	    running += diffs[i];
	}
	double nchoose2 = n*(n-1)/2;
	double sq = nchoose2*nchoose2;
	double prob = 0;
	for (int i = 0; i < 2*maxa; i++) {
	    if (sumdiffs[i] != 0 && diffgt[i] != 0) {
		double probsum = sumdiffs[i]/sq;
		prob += probsum*(diffgt[i]/nchoose2);
	    }
	}
	System.out.println(prob);
    }
}
