Given coin denominations (unlimited supply of each) and an amount, find the fewest coins needed to make that amount.
Input: line 1 — space-separated coin values; line 2 — the amount. Output: the minimum number of coins, or -1 if it cannot be made.
-1
Your program reads from stdin and prints to stdout.
Example 1
Input: 1 2 5 11
Output: 3
Hints