import java.io.*;
import java.util.*;
public class D626 {
public static void main(String[] args) throws IOException {
	input.init(System.in);
	PrintWriter out = new PrintWriter(System.out);
	int n = input.nextInt();
	int[] as = new int[n];
	for(int i = 0; i<n; i++) as[i] = input.nextInt();
	Arrays.sort(as);
	int[] ways = new int[5000];
	for(int i = 0; i<n; i++)
		for(int j = i+1; j<n; j++)
			ways[as[j] - as[i]]++;
	int[] pref = new int[10001];
	pref[0] = ways[0];
	for(int i = 1; i<pref.length; i++) pref[i] = (i < ways.length ? ways[i] : 0) + pref[i-1];
	long res = 0;
	long choose = n*(n-1)/2;
	for(int i = 0; i<ways.length; i++)
		for(int j = 0; j<ways.length; j++)
		{
			res += (long)ways[i] * ways[j] * (choose - pref[i+j]);
		}
	double d = res;
	for(int i = 0; i<3; i++) d /= choose;
	out.println(d);
	out.close();
}

public static class input {
	static BufferedReader reader;
	static StringTokenizer tokenizer;

	static void init(InputStream input) {
		reader = new BufferedReader(new InputStreamReader(input));
		tokenizer = new StringTokenizer("");
	}

	static String next() throws IOException {
		while (!tokenizer.hasMoreTokens())
			tokenizer = new StringTokenizer(reader.readLine());
		return tokenizer.nextToken();
	}

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

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

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

