import java.util.*;
import java.math.*;
public class ProblemD {

	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		int n = input.nextInt();
		int[] nums = new int[n];
		int[] diffs = new int[5000];
		int[] sums = new int[10000];
		for (int i = 0; i < n; i++)
		{
			nums[i] = input.nextInt();
		}
		Arrays.sort(nums);
		for (int j = 0; j < n; j++)
		{
			for (int k = j + 1; k < n; k++)
			{
				diffs[nums[k] - nums[j]]++;
			}
		}
		long sum = 0;
		for (int j = 0; j < 5000; j++)
		{
			sum += diffs[j];
			sums[2*j] += diffs[j]*diffs[j];
			for (int k = j + 1; k < 5000; k++)
			{
				sums[j+k] += 2*diffs[j]*diffs[k];
			}
		}
		/*StringBuilder s = new StringBuilder();
		for (int m = 0; m < 50; m++)
		{
			s.append(sums[m] + " ");
		}
		System.out.println(s);*/
		double count = 0;
		double denom = (double)sum;
		
		for (int j = 0; j < 5000; j++)
		{
			for (int k = j - 1; k > 0; k--)
			{
				count += diffs[j]*sums[k];
			}
			if (j == 100)
			{
				count /= denom;
			}
		}
		double num = count;
		num = num/denom;
		System.out.println(num/denom);
	}

}