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.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author AlexFetisov
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskD_CF_VC solver = new TaskD_CF_VC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD_CF_VC {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int[] a = Utils.readIntArray(in, n);
            Arrays.sort(a);
            int max = a[n - 1];

            double[] diff = new double[max + 1];
            double[] sum = new double[max + 2];

            for (int i = 0; i < n; ++i) {
                for (int j = 0; j < i; ++j) {
                    diff[a[i] - a[j]] += 1. / (n * (n - 1) / 2);
                }
            }
            for (int i = max; i >= 0; --i) {
                sum[i] = diff[i];
                if (i < max) sum[i] += sum[i + 1];
            }

            double res = 0;
            for (int a1 = 0; a1 <= max; ++a1) {
                for (int a2 = 0; a2 <= max; ++a2) {
                    if (a1 + a2 + 1 > max) continue;
                    res += diff[a1] * diff[a2] * sum[a1 + a2 + 1];
                }
            }
            out.println(res);
        }

    }

    static class InputReader {
        private BufferedReader reader;
        private StringTokenizer stt;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
        }

        public String nextLine() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                return null;
            }
        }

        public String nextString() {
            while (stt == null || !stt.hasMoreTokens()) {
                stt = new StringTokenizer(nextLine());
            }
            return stt.nextToken();
        }

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

    }

    static class Utils {
        public static int[] readIntArray(InputReader in, int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; ++i) {
                a[i] = in.nextInt();
            }
            return a;
        }

    }
}

