import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;


public class JerrysProtest {

	static IR in = new IR(System.in);
	static Integer balls[];
	static int diff[] = new int[5000+5];
	static int freq[] = new int[1000000+5];
	static int R = 100000;
	static int N;      
	static class Entry
	{
		int i,j;
		int atLeast;

		public Entry(int i,int j,int atLeast)
		{

		}
	}
	public static void main(String[]args)throws Throwable
	{

		N = in.j();
		balls = new Integer[N];
		for(int i = 0 ; i < N ; i++ )
		{
			balls[i] = in.j();
		}
		Arrays.sort(balls);
		for(int i = 0 ; i < N ; i++)
		{
			for(int j = i + 1 ; j < N ; j++)
			{

				++diff[balls[j] - balls[i]];
				++freq[balls[j] - balls[i]];

			}
		}
		
		for(int i = 1 ; i <= 5000 ; i++)
		{
			freq[i] += freq[i - 1];
		}

		int up = 0;
		int down = 0;
		for(int i = 0 ; i <= 5000 ; i++)
		{
			for(int j = 0 ; j <= 5000 ; j++)
			{
				int poss = diff[i] * diff[j];
				int d = i + j;
				up += (poss * (freq[5000] - freq[d]));
				down += (poss * freq[5000]);

			}
		}

		double res = (double)(1.0 * up / (down*1.0));

		System.out.printf("%.12f",res);
	}

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

		public IR(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream), 32768);
			tokenizer = null;
		}

		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

		public int j() {
			return Integer.parseInt(next());
		}
		public long ll(){
			return Long.parseLong(next());
		}

	}
}
