I work at Microsoft Asia Research Institute. What do you do first in the morning? View emails? No, I went to the water room to get a drink: green tea, Wang laoji, Starbucks Coffee, Coca-Cola ...... (Of course, many colleagues still take drinks as the second thing ).
Aunts prepare many drinks every day. To improve the service quality, they also collect statistics on their satisfaction with each type of beverage. After a while, aunts already have a large amount of data. They hope to find some useful information from the data to maximize the satisfaction and value of everyone. One morning, when the intern Xiaofei first rushed into the water room and once took five yogurt, four Wang laoji, and three fresh oranges, the aunts caught him and asked him to solve the problem of maximizing satisfaction.
From the statistics of aunts, Xiao Fei can know the satisfaction of each beverage. The aunts also told Xiaofei that STC (smart tea Corp.) is responsible for supplying drinks to the Institute, with a daily total of v. STC is amazing. Each of their drinks has a single capacity of 2 power. For example, Wang laoji, both of them are 2 ^ 3 = 8 litre and Cola are 2 ^ 5 = 32 litre. Of course, the stock of STC is also limited, which will be the maximum amount of each beverage. Each beverage is described in the statistical data (beverage name, capacity, quantity, and satisfaction.
Then, how does Xiaofei complete this task and find the maximum number of purchases with satisfaction?
Related Resources:
Editorial Department of the beauty of Programming|Douban, the beauty of Programming|The beauty of Programming|Author blog
Author Douban