import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Random;
import java.util.StringTokenizer;

public class Solution{
	
	static final int N = 5005;
	
	
    public static void main(String[] args) throws IOException {
     
    	FastScanner fs = new FastScanner();
    	PrintWriter out = new PrintWriter(System.out);
    	
    		
    		
    	int tt = 1;
    	while(tt-->0) {
    		
    		int n = fs.nextInt();
    		int[] a = fs.readArray(n);
    		
    		int[] cntdiff = new int[N];
    		int[] cumdiff = new int[N];
    		
    		ruffleSort(a);
    		
    		for(int i=0;i<n;i++) {
    			for(int j=i+1;j<n;j++) {
    				cntdiff[a[j]-a[i]]++;
    			}
    		}
    		
    		cumdiff[0] = cntdiff[0];
    		
    		for(int i=1;i<N;i++) cumdiff[i] = cumdiff[i-1] + cntdiff[i];
    		
    		
    		long ans = 0;
    		
    		for(int d3=1;d3<N;d3++) {
    			if(cntdiff[d3]==0) continue;
    			for(int d2=1;d2<d3;d2++) {
    				int d1 = d3-d2-1;
    				ans += (long)cntdiff[d3]*cntdiff[d2]*cumdiff[d1];
    			}
    		}
    		
    		double d = (n)*(n-1)/2;
    		double p = ans/d;
    		 p /= d;
    		 p /= d;
    		 out.println(p);
    		
    		
    		
    	}
    	
    		
    		
    		
    	out.close();
    		
    }
    
    
    
    
    
    
    static final Random random=new Random();
    	
    static void ruffleSort(int[] a) {
    	int n=a.length;//shuffle, then sort 
    	for (int i=0; i<n; i++) {
    		int oi=random.nextInt(n); int temp=a[oi];
    		a[oi]=a[i]; a[i]=temp;
    	}
    	Arrays.sort(a);
    }
   
  
    
    	
    	
    static class FastScanner{
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	StringTokenizer st = new StringTokenizer("");
     
    	public String next(){
    		while(!st.hasMoreElements()){
    			try{
    				st = new StringTokenizer(br.readLine());
    			} catch(IOException e){
    				e.printStackTrace();
    			}
    		}
    		return st.nextToken();
    	}
    		
    	public String nextLine() throws IOException {
    		return br.readLine();
    	}
    		
    	public int nextInt(){
    		return Integer.parseInt(next());
    	}
     
    	public int[] readArray(int n){
    		int[] a = new int[n];
    		for(int i=0;i<n;i++)
    			a[i] = nextInt();
    		return a;
    	}
    		
    	public long nextLong() {
    		return Long.parseLong(next());
    	}
    		
    	public char nextChar() {
    		return next().toCharArray()[0];
    	}
    }
   	
}