import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.io.FileNotFoundException;
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;
        FastScanner in = new FastScanner(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, FastScanner in, PrintWriter out) {
            int n = in.nextInt();
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = in.nextInt();
            }
            Arrays.sort(a);

            int Z = 5000;
            double[] p = new double[Z + 1];
            double v = 1.0 / (n * (n - 1) / 2);
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < i; j++) {
                    int k = a[i] - a[j];
                    p[k] += v;
                }
            }

            double[][] pc = new double[3][2 * Z + 1];
            pc[0][0] = 1;
            for (int i = 0; i < 2; i++) {
                for (int j = 0; j <= Z; j++) {
                    for (int k = 0; k + j <= Z; k++) {
                        pc[i + 1][j + k] += pc[i][j] * p[k];
                    }
                }
            }

            double ans = 0;
            for (int j = 0; j <= Z; j++) {
                for (int i = 0; i < j; i++) {
                    ans += p[j] * pc[2][i];
                }
            }

            out.printf("%.10f", ans);
        }

    }

    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
        }

        public FastScanner(String file) {
            try {
                br = new BufferedReader(new FileReader(file));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        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());
        }

    }
}

