import java.util.*;
import java.io.*;
import java.lang.*;
import java.math.*;
public class D {
    public static void main(String[] args) throws Exception {
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        // Scanner scan = new Scanner(System.in);
        // PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out)); 
        int n = Integer.parseInt(bf.readLine());
        StringTokenizer st = new StringTokenizer(bf.readLine());
        int[] a = new int[n];
        for(int i=0; i<n; i++) a[i] = Integer.parseInt(st.nextToken());
        int[] p = new int[5000];
        // values in p multiplied by (n choose 2)
        for(int i=0; i<n; i++)
        	for(int j=0; j<n; j++)
        		if(a[j] > a[i]) p[a[j]-a[i]]++;
        //System.out.println(Arrays.toString(p));
        int[] ps = new int[5001];
        ps[0] = 0;
        for(int i=1; i<=5000; i++)
        	ps[i] = ps[i-1] + p[i-1];
        // ps[i] is p[0]+..+p[i-1]
        long sum = 0;
    	for(int i=0; i<5000; i++) {
    		for(int j=0; j<5000; j++) {
    			if(i+j+1 <= 4999)
    				sum += 1L*p[i]*p[j]*(ps[5000]-ps[i+j+1]);
    		}
    	}
    	sum *= 8;
    	double ans = (sum + 0.0)/((1L*n*(n+1)/2)*(1L*n*(n+1)/2))/(1L*n*(n+1)/2);
    	System.out.println(ans);
    	
    	
    	
    	
        // int n = Integer.parseInt(st.nextToken());
        // int n = scan.nextInt();
        
        // out.close(); System.exit(0);
    }
}