The World Trade Foundation has -1
if this is not possible.
Constraints
It is guaranteed that
Input Specification
On the first line, there are two space-separated integers,
The next line contains
Output Specification
On one line, output the minimum number of coins needed to make a sum of exactly -1
if this is not possible.
Sample Input 1
Copy
3 10
1 2 4
Sample Output 1
Copy
3
Sample Input 2
Copy
5 263
1 5 10 50 100
Sample Output 2
Copy
7
Sample Input 3
Copy
3 7
2 6 12
Sample Output 3
Copy
-1
Comments
World Trade Foundation = WTF ?????