import java.text.DecimalFormat;
import java.util.*;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.BufferedOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.OutputStream;
public class jam {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int[] tab=new int[n];
		int max=0;
		for (int i=0; i<n; i++) {
			tab[i]=sc.nextInt();
			max=Math.max(max, tab[i]);
		}
		int[] and=new int[2*max+1];
		int[] jef=new int[2*max+1];
		for (int i=0; i<n; i++) {
			for (int j=0; j<n; j++ ) {
				if (tab[i]>tab[j]) {
					//System.out.println(tab[i]-tab[j]+max);
					and[tab[i]-tab[j]+max]++;
					jef[tab[j]-tab[i]+max]++;
				}
			}
		}
		int[] w1=new int[and.length+jef.length];
		for (int i=0; i<and.length; i++) {
			for (int j=0; j<and.length; j++) {
				w1[i+j]+=and[i]*and[j];
				
				
			}
		}
		int[] w2=new int[w1.length+jef.length];
		for (int i=0; i<w1.length; i++) {
			for (int j=0; j<jef.length; j++) {
				w2[i+j]+=w1[i]*jef[j];
			}
		}
		int sum=0;
		for (int i=0; i<3*max; i++) {
			sum+=w2[i];
		}
		//System.out.println(sum);
		long d=(n*(n-1))/2;
		d=d*d*d;
		double p=(double)sum/ (double) d;
		System.out.printf("%.10f\n" ,p);
		
		
 		
		

	}

}
/*class Kattio extends PrintWriter {
	   public Kattio(InputStream i) {
	       super(new BufferedOutputStream(System.out));
	       r = new BufferedReader(new InputStreamReader(i));
	   }
	   public Kattio(InputStream i, OutputStream o) {
	       super(new BufferedOutputStream(o));
	       r = new BufferedReader(new InputStreamReader(i));
	   }

	   public boolean hasMoreTokens() {
	       return peekToken() != null;
	   }

	   public int getInt() {
	       return Integer.parseInt(nextToken());
	   }

	   public double getDouble() {
	       return Double.parseDouble(nextToken());
	   }

	   public long getLong() {
	       return Long.parseLong(nextToken());
	   }

	   public String getWord() {
	       return nextToken();
	   }



	   private BufferedReader r;
	   private String line;
	   private StringTokenizer st;
	   private String token;

	   private String peekToken() {
	       if (token == null)
	           try {
	               while (st == null || !st.hasMoreTokens()) {
	                   line = r.readLine();
	                   if (line == null) return null;
	                   st = new StringTokenizer(line);
	               }
	               token = st.nextToken();
	           } catch (IOException e) { }
	       return token;
	   }

	   private String nextToken() {
	       String ans = peekToken();
	       token = null;
	       return ans;
	   }
}*/

