Problem code: CCHANGE
Given a value of x cents, and an infinite supply of coins of n denominations, followed by their denominations, find the least amount of coins required to make change for x.
Line 1: x, an integer between 1 and 10000
Line 2: n, the number of different denominations
Line 3..3+n: the denominations of the coins
An integer, on a single line - the least coins required to make change for x.
Input: 24 4 12 13 5 6 Output: 2
Point Value: 10
Time Limit: 2.00s
Memory Limit: 16M
Added: Apr 08, 2011
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3