import java.util.*;
public class ProtestDiff {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int N=sc.nextInt();
		int M=N*(N-1)/2;
		int[] nums=new int[N];
		for (int i=0; i<N; i++) {
			nums[i]=sc.nextInt();
		}
		int[] diff=new int[M];
		int temp=0;
		for (int i=0; i<N; i++) {
			for (int j=i+1; j<N; j++) {
				diff[temp]=nums[j]-nums[i];
				temp++;
			}
		}
		Arrays.sort(diff);
		int max=diff[M-1]+1;
		long combo=0;
		int[] numDiff=new int[max];
		int[] Psum=new int[max];
		temp=0;
		for (int i=1; i<max; i++) {
			while (temp<M) {
				if (diff[temp]>i) break;
				else {
					numDiff[i]++;
					temp++;
				}
			}
			Psum[i]=temp;
		}
		
		for (int i=1; i<max; i++) {
			for (int j=1; j<i-1; j++) {
				combo+=(long)numDiff[i]*(long)numDiff[j]*(long)Psum[i-j-1];
			}
		}
		long denom=(long)M*(long)M*(long)M;
		double prob=combo/(double)denom;
		System.out.println(prob);

	}

}
