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

public class Main {
    private final InputReader in;
    private final PrintWriter out;

    public Main(final InputReader in, final PrintWriter out) {
        this.in = in;
        this.out = out;
    }

    private static PrintWriter getOutput(final String filename) throws IOException {
        if (filename == null || filename.isEmpty()) {
            return new PrintWriter(new OutputStreamWriter(System.out));
        } else {
            return new PrintWriter(new FileWriter(filename + ".out"));
        }
    }

    public static void main(final String[] args) throws NumberFormatException, IOException {
        final String filename = "";
        final long time = System.currentTimeMillis();
        try (final InputReader in = new InputReader(filename); final PrintWriter out = getOutput(filename)) {
            new Main(in, out).solve();
        }
//        System.err.println("Running time: " + (System.currentTimeMillis() - time));
    }

    private void solve() throws IOException {
        final int MAXD = 5000;
        final int OFFSET = 3 * MAXD;

        final int n = in.nextInt();
        final int[] a = new int[n];
        for (int i = 0; i < n; i++) a[i] = in.nextInt();

        final long[] probabilityAfterSingleStep = new long[OFFSET * 2];
        for (int i = 0; i < n; i++) {
            for (int j = i + 1; j < n; j++) {
                probabilityAfterSingleStep[a[i] - a[j] + OFFSET]++;
                probabilityAfterSingleStep[a[j] - a[i] + OFFSET]++;
            }
        }

        final long[] probabilityAfter2steps = new long[OFFSET * 2];
        for (int d1 = 0; d1 > -MAXD; d1--) {
            for (int d2 = 0; d2 > -MAXD; d2--) {
                final long t = probabilityAfterSingleStep[d1 + OFFSET] * probabilityAfterSingleStep[d2 + OFFSET];
                if (d1 + d2 + OFFSET >= 0) {
                    probabilityAfter2steps[d1 + d2 + OFFSET] += t;
                }
            }
        }

        double success = 0;
        double all = 0;
        for (int d12 = 0; d12 > -2 * MAXD; d12--) {
            for (int d3 = 0; d3 < MAXD; d3++) {
                final long t = probabilityAfter2steps[d12 + OFFSET] * probabilityAfterSingleStep[d3 + OFFSET];
                all += t;
                if (d12 + d3 > 0) {
                    success += t;
                }
            }
        }

        out.println(String.format(Locale.ROOT, "%.15f", success / all));
    }

    private void assertTrue(final boolean t) {
        if (!t) throw new RuntimeException();
    }
}

class InputReader implements Closeable {
    private StringTokenizer st;
    private final BufferedReader in;

    public InputReader(final String filename) throws IOException {
        if (filename == null || filename.isEmpty())
            in = new BufferedReader(new InputStreamReader(System.in));
        else
            in = new BufferedReader(new FileReader(filename + ".in"));
    }

    public boolean hasNextToken() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            String line = in.readLine();
            if (line == null)
                return false;
            st = new StringTokenizer(line);
        }
        return true;
    }

    public String nextToken() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            String line = in.readLine();
            if (line == null)
                return null;
            st = new StringTokenizer(line);
        }
        return st.nextToken();
    }

    public String readLine() throws IOException {
        return in.readLine();
    }

    public int nextInt() throws NumberFormatException, IOException {
        return Integer.parseInt(nextToken());
    }

    public long nextLong() throws NumberFormatException, IOException {
        return Long.parseLong(nextToken());
    }

    public double nextDouble() throws NumberFormatException, IOException {
        return Double.parseDouble(nextToken());
    }

    @Override
    public void close() throws IOException {
        in.close();
    }
}