
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[] diffs = new int[5001];
		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]);
				diffs[pairs[p]]++;
				p++;
			}
		}
		
		int[] sufsum = new int[5001];
		sufsum[5000] = diffs[5000];
		for (int i=5000-1; i>=0; i--) {
			sufsum[i] = sufsum[i+1] + diffs[i];
		}

		int m = pairs.length;
		double ans=0;
		for (int i=0; i<diffs.length; i++) {
			if (diffs[i] == 0) continue;
			for (int j=i; j<diffs.length; j++) {
				if (diffs[j] == 0) continue;
				
				int needed = i + j + 1;
				if (needed >= diffs.length) break;
				
				if (j == i) ans += (diffs[i]/(double)m) * (diffs[j]/(double)m) * ((sufsum[needed])/(double)m);
				else ans += 2 * (diffs[i]/(double)m) * (diffs[j]/(double)m) * ((sufsum[needed])/(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;
		}
	}

}
