import java.util.Arrays;
import java.util.Scanner;

public class CF626D{
    public static void main(String[] args){
        Scanner scn = new Scanner(System.in);
        while (scn.hasNext()){
            int n = scn.nextInt();
            int nc2 = n*(n-1)/2;
            int[] all = new int[n];
            for (int i=0; i<n; i++){
                all[i] = scn.nextInt();
            }
            Arrays.sort(all);
            int maxDiff = all[n-1]-all[0];
            int[] diffNum = new int[maxDiff+1];
            for (int i=0; i<=maxDiff; i++){
                diffNum[i] = 0;
            }
            for (int i=0; i<n; i++){
                for (int j=i+1; j<n; j++){
                    diffNum[Math.abs(all[i]-all[j])]++;
                }
            }
            int[] gteNum = new int[maxDiff+1];
            gteNum[maxDiff] = diffNum[maxDiff];
            for (int d=maxDiff; d>0; d--){
                gteNum[d-1] = diffNum[d-1]+gteNum[d];
            }

            double ans = 0;
            for (int d1=0; d1<maxDiff; d1++){
                for (int d2=0; d2<maxDiff-d1; d2++){
                    if (diffNum[d1]==0 || diffNum[d2]==0)
                        continue;
                    double now = 1.0;
                    now *= 1.0*diffNum[d1]/nc2;
                    now *= 1.0*diffNum[d2]/nc2;
                    now *= 1.0*gteNum[d1+d2+1]/nc2;
                    ans += now;
                }
            }
            System.out.println(ans);
        }
    }
}