Given a list of coin denominations and a target amount, find the minimum number of coins needed to make exactly that amount (unlimited supply of each coin).
Input:
- Line 1: space-separated coin denominations
- Line 2: target amount
Output: the minimum number of coins, or -1 if it can't be made.