I will give you an example what I'm looking for.
Let's assume that I have the following numbers defined at the beginning of an algortihm:
7, 10, 30, 60
I want to find all possible combinations of this numbers that will be greater or equal to 350. Order of numbers doesn't matter (I'm not looking for permutations).
Sample results:
50 * 7 = 350 >= 350 (OK)
49 * 7 + 10 = 343 + 10 = 353 > 353 (OK)
48 * 7 + 10 = 336 + 10 = 346 < 353 (NOT OK)
...and so on (to use also dividers 30 and 60)
I want to point out, that the correct result should be equal or grater to 350, but also should be as close to 350 as it is possible (each divider has its own price -> The total price should be to lowest).
How should I caluculate such combinations?