import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.lang.String;
import java.util.Arrays;
import java.util.Scanner;



public class D {
	

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		//const Point U = new Point(0,1);
		
		
		Scanner reader = new Scanner(System.in);
		PrintWriter writer= new PrintWriter(System.out);
		
		String line = reader.nextLine();
		int n = Integer.parseInt(line);
		line = reader.nextLine();
		
		String[] strs = line.split("\\ ");
		int[] a = new int[n];
		for(int i = 0; i < n; i++) a[i] = Integer.parseInt(strs[i]);
		int[] dis = new int[n*(n-1)/2];
		int pos = 0;
		for(int i = 0; i < n-1; i++){
			for(int j = i+1; j < n; j++){
				dis[pos] = Math.abs(a[i]-a[j]);
				//writer.println(dis[pos]);
				pos++;
			}
		}
		Arrays.sort(dis);
		int[] numOfCouple = new int[5000];
		long[] count = new long[5000];
		for(int i = 0; i < numOfCouple.length; i++){
			numOfCouple[i] = 0;
			count[i] = 0;
		}
		for(int i = 0; i < dis.length; i++) numOfCouple[dis[i]]++;
		
		//for(int i = 0; i < 15; i++) writer.println("num: " + i + " " + numOfCouple[i]);
		
		for(int i = 3; i < 5000; i++){
			for(int j = 0; j <= (i-1)/2; j++){
				count[i] += numOfCouple[j]*numOfCouple[i-1-j];
			}
			count[i] += count[i-1];
		}
		
		//for(int i = 0; i < 15; i++) writer.println("count: "+ i +" " + count[i]);
		
		long choice = 0;
		for(int i = 0; i < 5000; i++){
			//writer.println(choices[i]);
			choice += numOfCouple[i] * count[i];
		}
		long mau = dis.length*dis.length*dis.length;
		double result = choice/((double) mau);
		//writer.println(choice);
		writer.println(result);
		
		
		reader.close();
		
		writer.flush();
		writer.close();
		
	}
	
	public static int search(int first, int last, int goal, int[] dis){
		while(first < last){
			int medium = (first+last)/2 + 1;
			if(dis[medium] <= goal) first = medium;
			else last = medium - 1;
		}
		if(dis[last] <= goal) return last;
		else return -1;
	}

}

