import java.io.*;
import java.util.*;

public class jerryProtest 
{
	
	public static void main(String args[])throws IOException
	{
		Scanner sc = new Scanner (System.in);
		PrintWriter out = new PrintWriter(System.out);
		
		int n = sc.nextInt();
		
		int [] a = new int [n];
		
		int max = 0;
		
		for (int i = 0; i<n; i++)
		{
			a[i] = sc.nextInt();
			max = Math.max(max, a[i]);
		}
		
		Arrays.sort(a);
		
		long [] diff = new long [max+1];
		long [] sum = new long [max+1];
		
		for (int i = 0; i<n; i++)
		{
			for (int j = i+1; j<n; j++)
				diff[a[j]-a[i]]++;
		}
		
		for (int i = max; i >= 0; --i)
		{
			sum[i] = diff[i];
			if (i < max)
				sum[i] += sum[i+1];
		}
		
		long count=  0;
		for (int firstGame = 0; firstGame<=max; firstGame++)
		{
			for (int secondGame = 0; secondGame<=max; secondGame++)
			{
				if (firstGame+secondGame+1 > max)	continue;
				count += diff[firstGame]*diff[secondGame]*sum[firstGame+secondGame+1];
			}
		}
		long total = (n*(n-1))/2;
		total = total*total*total;
		out.println(1.0*count/total);
		out.close();
	}
}
class pair
{
	int andrew;
	int jerry;
	pair(int a, int j)
	{
		andrew = a;
		jerry = j;
	}
}
