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];
		long[] sums = new long[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] += ((long)diffs[j])*diffs[j];
			for (int k = j + 1; k < 5000; k++)
			{
				sums[j+k] += 2*((long)diffs[j])*diffs[k];
			}
		}
		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]*((double)sums[k]);
			}
		}
		for (int i = 0; i < 3; i++)
		{
			count /= denom;
		}
		System.out.println(count);
	}

}