A dp solution to the coin-change problem