The Question is -

A Milkman serves milk in packaged bottles of varied sizes. The possible size of the bottles are {1, 5, 7 and

10} litres . He wants to supply desired quantity using as less bottles as possible irrespective of the size. Your objective is to help him find the minimum number of bottles required to supply the given demand of milk.

My code is here:

But it gives me a wrong answer .Can anyone suggest me where i am wrong .Thanks in advance.