private int computeExpectation(int[] pref, int[] dist, int nfruits, int bowlsz) {
        double exp = 0;
        for (int i = 0; i != 12; ++i) {
            double p = 1.0 * dist[i] / nfruits;
            exp += (p * pref[i] * bowlsz);
        }
        return (int)exp;
    }