import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.List;
import java.util.PriorityQueue;
import java.util.StringTokenizer;

public class Main
{

	/* IO */
	InputReader in;
	StringTokenizer tok;
	StringBuilder ans;

	/* FIELDS */
	int n;
	int arr[];
	int max = 5000;

	public static void main(String[] args) throws FileNotFoundException
	{
		Main sol = new Main();
		sol.begin();

	}

	private void begin() throws FileNotFoundException
	{
		// io
		boolean file = false;
		if (file)
			in = new InputReader(new FileInputStream("input.txt"));
		else
			in = new InputReader(System.in);
		ans = new StringBuilder();

		// read
		n = in.nextInt();
		arr = new int[n];
		for (int i = 0; i < n; i++)
			arr[i] = in.nextInt();

		// solve
		System.out.println(solve());
	}

	private double solve()
	{
		// one round diff probability distribution
		double oneRound[] = new double[max + 1];
		long count = 0;
		for (int i = 0; i < n; i++)
			for (int j = 0; j < n; j++)
				if (arr[i] > arr[j])
				{
					oneRound[arr[i] - arr[j]]++;
					count++;
				}
		for (int i = 0; i <= max; i++)
			oneRound[i] /= count;

		// two round diff
		double twoRound[] = new double[max + 1];
		for (int firstRound = 0; firstRound <= max; firstRound++)
			for (int secondRound = 0; secondRound <= max; secondRound++)
				if (firstRound + secondRound <= max)
					twoRound[firstRound + secondRound] += oneRound[firstRound] * oneRound[secondRound];

		// acc diff
		double twoRoundAcc[] = new double[max + 2];
		for (int i = 1; i <= max; i++)
			twoRoundAcc[i] = twoRound[i] + twoRoundAcc[i - 1];

		// third round
		double sum = 0;
		for (int thirdRound = 1; thirdRound <= max; thirdRound++)
			sum += oneRound[thirdRound] * twoRoundAcc[thirdRound - 1];
		return sum;
	}
}

class InputReader
{
	BufferedReader reader;
	StringTokenizer tok;

	public InputReader(InputStream stream)
	{
		reader = new BufferedReader(new InputStreamReader(stream), 32768);
		tok = new StringTokenizer("");
	}

	public String next()
	{
		while (!tok.hasMoreTokens())
			try
			{
				tok = new StringTokenizer(reader.readLine());
			} catch (IOException e)
			{
				e.printStackTrace();
			}
		return tok.nextToken();
	}

	public int nextInt()
	{
		return Integer.parseInt(next());
	}
}