algs4; exercise 1.1.18 - crazy multiplication and exponentiation