A tollgate charges an exact fare of F units and gives no change. You carry an unlimited supply of coins in each of n distinct denominations. Pay the fare using as few coins as possible. Report the minimum number of coins whose values add up to exactly F, or -1 if the fare cannot be paid exactly with the available denominations.
Input format
Line 1: two integers n and F.
Line 2: n space-separated distinct integers, the coin denominations.
Output format
A single integer: the minimum number of coins summing to exactly F, or -1 if impossible.
Constraints
- 1 <= n <= 12
- 1 <= each denomination <= 1000
- 0 <= F <= 20000