My problem is as follows-
I have some numbers with me, like below-
2
2
2
2
3
3
17
17
17
17
17
17
17
17
17
34
34
34
34
34
68
68
68
136
So if I give the following number as input, the output should be as follows-
[output is the sum of given number, that just greater than the input]
Input Output
3 2,2
4 2,2
254 17,34,68,136
7 2,3,3 [or also with 2,2,2,2 but if return same sum,
then number count should min]
205 2,68,136
10 2,2,3,3
I don't just want to try each and every combination (i.e brute force) to get the result. So just want to ask is there any efficient algorithm possible for the above situation.
Thanks.