Algorithm written test surface Test _ Mall engage in activities, full 100 minus 30, full 200 minus 80, ask 1000 yuan the most can buy what money?

Source: Internet
Author: User

Algorithm written test surface Test _ Mall engage in activities, full 100 minus 30, full 200 minus 80, ask 1000 yuan the most can buy what money?

Solution Ideas:

1, first spend 1000 yuan, return (1000/200) *80 = 400

2, spend 400 yuan, return (400/200) *80 = 160;

3, borrow someone else 40 yuan, hand gather enough 200 yuan, return 80 yuan.

4, also give others 40 yuan, hand also has 40 yuan, also can buy 40 yuan of thing.

That is, a total of buy 1000+400+40+160+80-40=1640 yuan.

Is there a better way? If you have any, please correct me.

Algorithm written test surface Test _ Mall engage in activities, full 100 minus 30, full 200 minus 80, ask 1000 yuan the most can buy what money?

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.