import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;

public class D626 {

    public static final int MAX_BALL = 5001;

    public static void main(String[] args) throws IOException {
        ContestsScanner sc = new ContestsScanner();
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
        int n = sc.nextInt();
        int[] balls = Arrays.stream(sc.nextInts(n)).sorted().toArray();
        int[] scores = new int[MAX_BALL];
        int total_scores = 0;
        for (int i = 0; i < balls.length; i++) {
            for (int j = i + 1; j < balls.length; j++) {
                scores[balls[j] - balls[i]]++;
                total_scores++;
            }
        }

        long total_counts = (long) total_scores * total_scores * total_scores;
        long lower_count = 0;
        long score = 0;
        for (int i = 1; i < scores.length; i++) {
            for (int j = 0; j < i; j++) {
                lower_count += (long) scores[j] * scores[i - j - 1];
            }
            score += (long) scores[i] * lower_count;
        }
        out.printf("%.10f\n", (double) score / (double) total_counts);
        out.close();
    }

    public static class ContestsScanner {

        private final BufferedReader br;
        private StringTokenizer tokenizer;

        public ContestsScanner() throws IOException {
            br = new BufferedReader(new InputStreamReader(System.in));
            tokenizer = new StringTokenizer(br.readLine());
        }

        String nextToken() {
            if (!tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        int nextInt() {
            return Integer.valueOf(nextToken());
        }

        int[] nextInts(int n) {
            int[] result = new int[n];
            for (int i = 0; i < n; i++) {
                result[i] = Integer.valueOf(nextToken());
            }
            return result;
        }
    }
}