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
 */
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);
        d626 solver = new d626();
        solver.solve(1, in, out);
        out.close();
    }

    static class d626 {
        public void solve(int testNumber, InputReader 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 max = a[n - 1];
            double[] pos = new double[max + 1];
            double posOne = 2.0 / (n * (n - 1));
            for (int i = 0; i < n; i++) {
                for (int j = i + 1; j < n; j++) {
                    pos[a[j] - a[i]] += posOne;
                }
            }
            double[] posBiggerDiff = new double[max + 2];
            for (int i = max - 1; i >= 0; i--) {
                posBiggerDiff[i] = posBiggerDiff[i + 1] + pos[i];
            }
            double ans = 0;
            for (int i = 0; i <= max; i++) {
                for (int j = 0; j <= max; j++) {
                    if (i + j + 1 > max) break;
                    ans += pos[i] * pos[j] * posBiggerDiff[i + j + 1];
                }
            }
            out.println(ans);
        }

    }

    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 next() {
            while (stt == null || !stt.hasMoreTokens()) {
                stt = new StringTokenizer(nextLine());
            }
            return stt.nextToken();
        }

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

    }
}

