Interview question: beverage supply

Source: Internet
Author: User

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

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.