import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.util.InputMismatchException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int[] a = new int[n];
            for (int i = 0; i < n; ++i) {
                a[i] = in.nextInt();
            }

//        n = 2000;
//        a = new int[n];
//        for (int i = 0; i < n; ++i) {
//            a[i] = i * 5000 / n + 1;
//        }

            int X = 5000;
            boolean[] possible = new boolean[X + 1];
            for (int i = 0; i < n; ++i) {
                for (int j = i + 1; j < n; ++j) {
                    possible[Math.abs(a[i] - a[j])] = true;
                }
            }
            int pairs = n * (n - 1) / 2;
            double[] p1 = new double[X + 1];
            for (int delta = 1; delta < possible.length; ++delta) {
                if (possible[delta]) {
                    p1[delta] += 1.0 / pairs;
                }
            }
            double[] p2 = new double[2 * X + 1];
            for (int currDelta = 0; currDelta < p1.length; ++currDelta) {
                if (p1[currDelta] != 0.0) {
                    for (int delta = 1; delta < possible.length; ++delta) {
                        if (possible[delta]) {
                            p2[currDelta + delta] += p1[currDelta] / pairs;
                        }
                    }
                }
            }
            double res = 0;
            for (int currDelta = 0; currDelta < p2.length; ++currDelta) {
                if (p2[currDelta] != 0.0) {
                    for (int delta = 1; delta < possible.length; ++delta) {
                        if (possible[delta] && currDelta < delta) {
                            res += p2[currDelta] / pairs;
                        }
                    }
                }
            }
            out.printf("%.20f\n", res);
        }

    }

    static class InputReader {
        BufferedReader bufReader;
        StringTokenizer stringTokenizer;
        boolean isEof = false;

        public InputReader(InputStream stream) {
            bufReader = new BufferedReader(new InputStreamReader(stream));
        }

        public String next() {
            while (stringTokenizer == null || !stringTokenizer.hasMoreTokens()) {
                try {
                    String line = bufReader.readLine();
                    if (line == null) {
                        isEof = true;
                        return null;
                    }
                    stringTokenizer = new StringTokenizer(line);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
            }
            return stringTokenizer.nextToken();
        }

        public int nextInt() {
            String s = next();
            if (s == null) {
                return 0;
            }
            return Integer.parseInt(s);
        }

    }
}

