This is a version of the coin-changing problem. As such, it is a dynamic programming problem.
I know how to determine if you can make change if either you can use at most one coin of each denomination or if you can use at most k coins, but not both.