You are given coin denominations and a target amount. Using an unlimited supply of each coin, find the minimum number of coins that sum exactly to the amount.
Input
The first line contains the integer amount.
The second line contains the integer m, the number of coin types.
The third line contains m positive integers: the coin denominations.
Output
The minimum number of coins that make amount, or -1 if it cannot be made. (Making an amount of 0 needs 0 coins.)