The number of Blue bridge cups (maths, not understanding)

Source: Internet
Author: User

The number of previous questions cannot be purchased time limit: 1.0s memory limit: 256.0MBProblem description

Xiao Ming opened a candy shop. His ingenuity: to pack the fruit candy into 4 packs and 7 packs of two. Sweets cannot be sold by unpacking.

When the children came to buy the sugar, he used the two kinds of packaging to combine. Of course, some of the number of sweets can not be combined, such as to buy 10 sugar.

You can test it with a computer, in which case the maximum quantity that cannot be bought is 17. Any number greater than 17 can be combined with 4 and 7.

The requirement of the subject is to find the maximum number of characters that cannot be combined when the quantity of two packages is known.

Input format

Two positive integers representing the number of sugars in each package (no more than 1000)

Output format

A positive integer representing the maximum number of sugars that cannot be bought

Sample Input 14 7
Sample output 117 Sample input 23 5
Sample output 27 I just looked at the data, blindfolded, who knows, but obviously is not right, when 2 4, do not meet, should be mutually exclusive time to meet, not mutually exclusive should be this number +1 (will not, I do not know is not, see data guessed) AC code
#include <stdio.h>int main () {int a,b;while (scanf ("%d%d", &a,&b)!=eof) {printf ("%d\n", A*b-a-b);}}


The number of Blue bridge cups (maths, not understanding)

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.