To improve RECURSIVECHANGE, we can use the same strategy as we did
for the Fibonacci problem—all we really need to do is use the fact that the
solution for M relies on solutions for M − c1, M − c2, and so on, and then
reverse the order in which we solve the problem. This allows us to leverage
previously computed solutions to form solutions to larger problems and
avoid all this recomputation.