import java.util.Arrays;
import java.util.Scanner;

public class Protest
{
	public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int[] values = new int[n];
		for (int i = 0; i < n; i++)
		{
			values[i] = in.nextInt();
		}
		
		Arrays.sort(values);

		int[] numDiff = new int[5000];
		for (int i = 0; i < n; i++)
		{
			for (int j = i + 1; j < n; j++)
			{
				numDiff[values[j] - values[i]]++;
			}
		}
		
		int[] numAbove = new int[5000];
		for (int i = 4998; i > 0; i--)
		{
			numAbove[i] = numAbove[i + 1] + numDiff[i + 1];
		}
		
		long total = n * n * n * (n - 1) * (n - 1) * (n - 1) / 8;
		long num = 0;
		for (int i = 0; i < 5000; i++)
		{
			if (i < 2500) num += numDiff[i] * numDiff[i] * numAbove[2 * i];
			for (int j = i + 1; j < 5000 - i; j++)
			{
				num += 2 * numDiff[i] * numDiff[j] * numAbove[i + j];
			}
		}
		
		System.out.println((double) num / (double) total);
	}
}
