number of items not purchased in previous examsTime limit: 1.0s memory limit: 256.0MB
Problem 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
Java source code:
1 ImportJava.util.Scanner;2 Public classMain {3 4 Public Static voidMain (string[] args) {5Scanner in =NewScanner (system.in);6 intX1 =in.nextint ();7 intx2 =in.nextint ();8SYSTEM.OUT.PRINTLN (x1 * x2-x1-x2);//you're right, it's that simple.9 }Ten}
|
Detailed Records |
Evaluation Point serial number |
Evaluation Results |
score |
CPU Usage |
Memory Usage |
Download Evaluation Data |
1 |
That's right |
33.33 |
171ms |
23.32MB |
Input/Output |
2 |
That's right |
33.33 |
156ms |
23.41MB |
Input/Output |
3 |
That's right |
33.33 |
140ms |
23.29MB |
Input/Output |
|
"Blue Bridge Cup" the number of previous questions cannot be bought