# Find algorithm for statiscits problem find all solutions if exist

please i am trying find algorithm for 3 months but unsuccesful, i asked my teaches of theretics informatics but unsuccesfull too.

problem. for example my Mum give me 50€ with condition -> can spend 35 - 40€ but need buy only 5 different items (different prices). I need all posibilities.

I know so problem hasn't always solution.

Sorry for english.

Example products prices {1,1.1,1.3,2,3,4,5,6.6,7,10} can spend 10-14.5€ need buy 4 products

solutions
1)     1, 1.1, 1.3, 7 = 10,4
2)     1,   2,   3, 4 = 10
3)   1.1,   2,   3, 4 = 10,1
3)   1.3,   2,   3, 4 = 10,2
4)     2,   3,   4, 5 = 14
5)     1, 1.1, 1.3, 10= 13,4
..
...
....


Thanks for any help

please if you have questions write here, not vote for -1..

• Is there any reason a brute force solution would not work for you? – dkaeae Jan 24 at 15:29
• is not effective, lot of time spend because my "products" is 50+ and its lot of options. At best i want run alghorithm on android devices not server. (it depends on complexity) – Parad0X Jan 24 at 15:46