public Polynomial pow(int e) {
        Polynomial x = this;
        Polynomial r = one();
        while (e > 0) {
            if ((e & 1) != 0) r = r.mul(x);
            e >>= 1;
            x = x.mul(x);
        }
        return r;
    }