import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.PriorityQueue;
import java.util.SortedMap;
import java.util.StringTokenizer;
import java.util.TreeMap;

public class D {
	

	public static void main(String[] args) {

		MyScanner in = new MyScanner();
		int n = in.nextInt();
		int[] a = new int[n];
		
		for(int i=0;i<n;++i){
			a[i] = in.nextInt();
		}
		
		Arrays.sort(a);
		
		double[] delta = new double[a[n-1]-a[0]+1];
		double[] d2 = new double[2*(a[n-1]-a[0])+1];
		
		for(int i=1;i<n;++i){
			for(int j=0;j<i;++j){
				if(a[j]<a[i]){
					delta[a[i]-a[j]]+=1.0/(double)(n*(n-1)/2);
				}
			}
		}
		
		
		for(int i=0;i<delta.length;++i){
			for(int j=0;j<delta.length;++j){
				d2[i+j] += (delta[i]*delta[j]); 
			}
		}
				
		double result = 0;
		
		for(int i=1;i<delta.length;++i){
			double r = 0;
			for(int j=0;j<i;++j){
				r+=d2[j];
			}
			result += r*delta[i];
		}
		
		System.out.println(result);
		
	}

	

	// -----------PrintWriter for faster output---------------------------------
	public static PrintWriter out = new PrintWriter(System.out);

	// -----------MyScanner class for faster input----------
	public static class MyScanner {
		BufferedReader br;
		StringTokenizer st;

		public MyScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}

	}
	// --------------------------------------------------------

}
