import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

/**
 * Created by pallavi on 14/2/16.
 */
public class D626 {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(reader.readLine());
        StringTokenizer tokenizer = new StringTokenizer(reader.readLine());
        boolean[] ac = new boolean[5001];
        for (int i = 0; i < n; i++) {
            ac[Integer.parseInt(tokenizer.nextToken())] = true;
        }
        float[] dc = new float[5001];
        for (int i = 0; i <= 5000; i++) {
            if (!ac[i]) continue;
            for (int j = 0; j < i; j++) {
                if (ac[j]) dc[i-j] += 2.0/(n*(n-1));
            }
        }
        float[] cdc = new float[5001];
        float c = 0;
        for (int i = 5000; i >= 0; i--) {
            cdc[i] = c;
            c += dc[i];
        }
        float[] ddc = new float[5001];
        for (int i = 0; i <= 5000; i++) {
            if (dc[i]==0) continue;
            for (int j = 0; j <= 5000; j++) {
                if (i+j>5000) continue;
                ddc[i+j] = dc[i]*dc[j];
            }
        }
        float s = 0;
        for (int i = 0; i <= 5000; i++) {
            s += ddc[i]*cdc[i];
        }
        System.out.println(s);
    }
}
