import java.util.*;
import java.io.*;

public class TaskD {
    private FastScanner in;
    private PrintWriter out;

    final int MAXVAL = 5100;
    public void solve() throws IOException {
        int n = in.nextInt();
        int[] a = new int[n];

        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
        }
        long totalVariants = 0;
        long[] count = new long[MAXVAL];
        long[] numMoreThan = new long[MAXVAL];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                if (a[i] > a[j]) {
                    count[a[i] - a[j]]++;
                    totalVariants++;
                }
            }
        }
        for (int i = MAXVAL - 2; i >= 0; i--) {
            numMoreThan[i] = numMoreThan[i + 1] + count[i + 1];
        }
        long[] sums = new long[MAXVAL * 2];
        for (int i = 0; i < MAXVAL; i++) {
            for (int j = 0; j < MAXVAL; j++) {
                sums[i + j] += count[i] * count[j];
            }
        }
        long countCombintations = 0;
        for (int i = 0; i < MAXVAL; i++) {
            countCombintations += sums[i] * numMoreThan[i];
        }

        double res = (countCombintations + 0.0) / (totalVariants * totalVariants * totalVariants);
        out.println(res);
    }

    public void run() {
        try {
            in = new FastScanner();
            out = new PrintWriter(System.out);
            solve();
            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    private class FastScanner {
        private BufferedReader br;
        private StringTokenizer st;

        public FastScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

    }

    public static void main(String[] arg) {
        new TaskD().run();
    }
}