import java.util.Scanner;

/**
 * Created by eldar on 2/12/16.
 */
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] balls = new int[n];
        for(int i = 0; i < n; i++)
            balls[i] = in.nextInt();

        int[] winCnt = new int[5000];
        for(int i = 0; i < n; i++)
            for(int j = i + 1; j < n; j++) {
                if (balls[i] > balls[j]) {
                    winCnt[balls[i] - balls[j]]++;
                } else {
                    winCnt[balls[j] - balls[i]]++;
                }
            }

        final int ZERO = 15000;
        long[][] dp = new long[4][2 * ZERO + 1];
        dp[0][ZERO] = 1;

        for(int round = 0; round < 3; round++) {
            for(int diff = 0; diff <= 2 * ZERO; diff++) {
                if (dp[round][diff] == 0) continue;
                //System.out.println(round + " " + diff + " " + dp[round][diff]);
                for(int roundDiff = 1; roundDiff < 5000; roundDiff++) {
                    if (round == 2) {
                        dp[round + 1][diff - roundDiff] += winCnt[roundDiff] * dp[round][diff];
                    } else {
                        dp[round + 1][diff + roundDiff] += winCnt[roundDiff] * dp[round][diff];
                    }
                }
            }
        }

        double allValid = 0, jerryValid = 0;
        for(int i = 0; i <= ZERO * 2; i++) {
            allValid += dp[3][i];
            //if (dp[3][i] > 0) System.out.println(i + " " + dp[3][i]);
            if (i < ZERO) jerryValid += dp[3][i];
        }
        //System.out.println(jerryValid + " " + allValid);
        System.out.println(jerryValid / allValid);
    }
}
