
import java.util.*;
import java.io.*;

public class JerrysProtest {

	// https://codeforces.com/contest/626/problem/D
	
	public static void main(String[] args) throws IOException, FileNotFoundException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		//BufferedReader in = new BufferedReader(new FileReader("JerrysProtest"));

		int n = Integer.parseInt(in.readLine());
		int[] a = new int[n];
		StringTokenizer st = new StringTokenizer(in.readLine());
		for (int i=0; i<n; i++) {
			a[i] = Integer.parseInt(st.nextToken());
		}
		
		int[] pairs = new int[n*(n-1)/2];
		int p=0;
		for (int i=0; i<n; i++) {
			for (int j=i+1; j<n; j++) {
				pairs[p] = Math.abs(a[i] - a[j]);
				p++;
			}
		}
		
		Arrays.parallelSort(pairs);
		
		int m = pairs.length;
		double ans=0;
		for (int i=0; i<m; i++) {
			int jerry = i;
			for (int j=i; j<m; j++) {
				while (jerry < m && pairs[jerry] <= pairs[i] + pairs[j]) {
					jerry++;
				}
				if (jerry == m) break;
				
				ans += (1/(double)m) * (1/(double)m) * ((m - jerry)/(double)m);
				
			}
		}
		
		System.out.println(ans);

	}

	public static void sort(int[] a) {
		shuffle(a);
		Arrays.sort(a);
	}

	public static void shuffle(int[] a) {
		Random get = new Random();
		for (int i = 0; i < a.length; i++) {
			int r = get.nextInt(a.length);
			int temp = a[i];
			a[i] = a[r];
			a[r] = temp;
		}
	}

}
