import java.io.*;
import java.text.DecimalFormat;
import java.util.StringTokenizer;

public class Main {
    public void solve() {
        int n = ni();
        int m = 5001;
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = ni();
        }
        int[] difs = new int[m];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                if (a[i] > a[j]) {
                    difs[a[i] - a[j]]++;
                }
            }
        }
        int[] cum = new int[m];

        for (int i = m - 2; i >= 0; i--) {
            cum[i] = difs[i + 1] + cum[i + 1];
        }

        long total = 0;
        for (int i = 0; i < m; i++) {
            for (int j = 0; i + j < m; j++) {
                if ((difs[i] != 0) && (difs[j] != 0)) {
                    total += ((long) difs[i]) * difs[j] * cum[i + j];
                }
            }
        }
        long rc = n * (n - 1) / 2;
        double ans = (double) total / (rc * rc * rc);

        write(new DecimalFormat("0.00000000").format(ans) + "\n");
    }



    public static void main(String[] args){
        Main m = new Main();
        m.solve();
        try {
            m.writer.close();
        } catch (IOException e) {};
    }
    BufferedReader reader;
    BufferedWriter writer;
    StringTokenizer tokenizer;
    public Main() {
        reader = new BufferedReader(new InputStreamReader(System.in));
        writer = new BufferedWriter(new OutputStreamWriter(System.out));
    }
    int ni() {
        return Integer.parseInt(n());
    }
    long nl() {
        return Long.parseLong(n());
    }
    String n() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {}
        }
        return tokenizer.nextToken();
    }
    void write(String s) {
        try {
            writer.write(s);
        } catch(IOException e) {};
    }
}