Given a value of cents, and an infinite supply of coins of denominations, followed by their denominations, find the least amount of coins required to make change for .
Line : , an integer between and .
Line : , the number of different denominations.
Line : the denominations of the coins.
An integer, on a single line - the least coins required to make change for .
24 4 12 13 5 6