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)