import java.util.*;
public class ProD {
	static int n,max;
	static long a,ct;
	static double ans;
	static int[] aa=new int[2005];
	static long[] mm=new long[5005];
	static long[] pp=new long[10005];

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		n=in.nextInt();
		for(int i=1;i<=n;i++)
			aa[i]=in.nextInt();
		Arrays.sort(aa,1,n+1);
		for(int i=1;i<=n;i++)
		for(int j=i+1;j<=n;j++)
		{
			mm[aa[j]-aa[i]]++;
			if(aa[i]!=aa[j]) ct++;
			max=Math.max(max,aa[j]-aa[i]);
		}
		for(int i=max;i>=0;i--)
			pp[i]=pp[i+1]+mm[i];
		for(int i=1;i<=max;i++)
		for(int j=1;j<=max;j++)
			a+=mm[i]*mm[j]*pp[i+j+1];
		ans=(double)a/(ct*ct*ct);
		System.out.println(ans);
	}
}
