import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author toshif
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(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, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = Integer.valueOf(in.next());
            }

            Arrays.sort(a);

            long[] d = new long[5005];
            for (int i = 0; i < a.length; i++) {
                for (int j = i + 1; j < a.length; j++) {
                    int diff = a[j] - a[i];
                    d[diff]++;
                }
            }

            long[] d2 = new long[10_025];
            for (int i = 0; i < d.length; i++) {
                for (int j = 0; j < d.length; j++) {
                    int td = i + j;
                    d2[td] += d[i] * d[j];
                }
            }

            long tot = 0;
            long deno = 0;
            for (int i = 0; i < d.length; i++) {
                for (int j = 0; j < d.length; j++) {
                    deno += d[j] * d2[i];
                    if (i < j) {
                        tot += d[j] * d2[i];
                    }
                }
            }

            out.println(1.0 * tot / deno);
        }

    }
}

