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 xwchen
 */
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] = in.nextInt();
            }
            int[] cnt = new int[10005];
            Arrays.fill(cnt, 0);
            int offset = 5000;
            double total = n * (n - 1) / 2;
            for (int i = 0; i < n; ++i) {
                for (int j = 0; j < n; ++j) {
                    if (i != j) {
                        cnt[a[i] - a[j] + offset]++;
                    }
                }
            }
            int[] sum = new int[10005];
            Arrays.fill(sum, 0);
            for (int i = offset; i >= 0; --i) {
                sum[i] = sum[i + 1] + cnt[i + offset];
            }
            double res = 0;
            for (int i = 1; i < offset; ++i) {
                for (int j = 1; j < offset; ++j) {
                    double p = cnt[offset - i] / total;
                    p = p * cnt[offset - j] / total;
                    p = p * sum[i + j + 1] / total;
                    res += p;
                }
            }
            out.println(res);
        }

    }
}

