Premium Content - Free Preview
In the Kingdom of Zumbania, the Currency printer can only print the digit
1. Thus they have 3 different denominations:
111. You need to determine if you can reach a certain sum with a given set of coins.
You will be given a line of input (as an array) consisting of 4 integers for the number of 1-coins, 11-coins, 111-coins, and the desired sum.
For example, the input
1 2 3 356 means there's
3 111-coins and a desired sum of