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 ATailouloute
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        QuickScanner in = new QuickScanner(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, QuickScanner in, PrintWriter out) {
            int n = in.nextInt();
            int[] a = in.nextIntArray(n);
            Arrays.sort(a);
            int max = 5001;
            int total = n * (n - 1) / 2;
            int[] cnt = new int[max];
            int[] prefCnt = new int[max];
            for (int i = 0; i < n; i++) {
                for (int j = i + 1; j < n; j++) {
                    cnt[a[j] - a[i]]++;
                }
            }
            for (int i = 1; i < max; i++) {
                prefCnt[i] = prefCnt[i - 1] + cnt[i];
            }
            double ans = 0.0;
            for (int i = 1; i < max; i++) {
                if (cnt[i] != 0) {
                    for (int j = 0; j < i; j++) {
                        if (cnt[j] != 0) {
                            int up_to = i - j - 1;
                            int nb = cnt[j] * prefCnt[up_to];
                            ans += 1.0 * prefCnt[up_to] / total * 1.0 * cnt[j] / total * 1.0 * cnt[i] / total;
                        }
                    }
                }
            }
            out.println(ans);
        }

    }

    static class QuickScanner {
        BufferedReader br;
        StringTokenizer st;
        InputStream is;

        public QuickScanner(InputStream stream) {
            is = stream;
            br = new BufferedReader(new InputStreamReader(stream), 32768);
        }

        String nextToken() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

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

        public int[] nextIntArray(int len) {
            int[] a = new int[len];
            for (int i = 0; i < len; i++) {
                a[i] = nextInt();
            }
            return a;
        }

    }
}

