
import java.util.Scanner;

public class Problem_04 {

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = Integer.valueOf(input.nextLine());
        int[] a = new int[n];
        long[] sum = new long[5000];
        long[] sumsum = new long[5000];
        for (int i = 0; i < n; i++) {
            a[i] = input.nextInt();
        }
        for (int i = 0; i < n; i++) {
            for (int j = i + 1; j < n; j++) {
                sum[Math.abs(a[i] - a[j])]++;
            }
        }

        long sumc = 0;
        for (int i = 4999; i >=0 ; i--) {
            sumc += sum[i];
            sumsum[i] = sumc;
        }

        long res = 0;
        for (int i = 0; i < 5000; i++) {
            for (int j = 0; j < 5000; j++) {
                if (i+j+1 > 4999) continue;
                res += sumsum[i+j+1]*sum[i]*sum[j];
            }
        }

        long total = n * (n-1) / 2;
        total = total*total*total;


        System.out.println((double) res / (double) total);
    }
}
