import java.util.*;

public class Moda {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long[] f = new long[10500], cnt = new long[10050], pref = new long[10050];
        for (int i = 0; i < n; ++i) {
            f[sc.nextInt()]++;
        }
        for (int x = 1; x < 5050; ++x) {
            for(int val = 1; val < 5050; ++val) {
                cnt[x] += f[val] * f[val + x];
            }
        }
        for (int i = 1; i < 5050; ++i) {
            pref[i] = pref[i-1] + cnt[i];
        }
        long ret = 0;
        for (int fix = 1; fix < 5050; ++fix) {
            long pairs = 0;
            for (int i = 1; i < fix; ++i) {
                pairs += pref[Math.min(i, fix - i) - 1] * cnt[i] * 2;
            }
            for (int i = 1; i * 2 < fix; ++i) {
                pairs += cnt[i] * cnt[i];
            }
            ret += pairs * cnt[fix];
        }
        long zn = n * (n - 1) / 2;
        System.out.printf("%.09f\n", (double)ret / zn / zn / zn);
    }
}
