HBC223616[NOIP1998]幂次方,枚举HRemainderReminder题解

惰性的成熟 算法基础篇 27 0
题库丰富多样,涵盖各个领域,全网最全C++题库,让您在练习中不断成长!
“Hey Bill, you were in charge of shipping those novelty book remainders to Remainderville, OH, right?”asked Fred. “Those were cute little books weren’t they, each shaped like a cube one inch on each side. I can’t understand why they didn’t sell better. Can you remind me how many we shipped?”said Fred, rubbing his increasingly aching head. “That’s it,” confirmed Bill. “Sounds like some grossly convoluted computer programming problem!”

“Hey Bill, you were in charge of shipping those novelty book remainders to Remainderville, OH, right?” asked Fred. “Those were cute little books weren’t they, each shaped like a cube one inch on each side. I can’t understand why they didn’t sell better. Can you remind me how many we shipped?”  “Well,” started Bill, “I can’t remember the number exactly. I do remember that we tried three different size boxes. When we used the largest box size we had 407 books remaining after filling all of the rest completely. When we tried the second largest box size we had 409 books left over, and when we tried the smallest box size we only had 17 books left over.” “Okay,” a slightly puzzled Fred continued, “then just let me know the box sizes and the number of boxes you used.”  “Funny thing” replied Bill, “I can’t remember that either. I do remember that the boxes were made from a 16 by 21 inch sheet of cardboard, with squares cut out at each of the four corners. We then folded the sides up to make an open top box, filled each box with books, then used packaging tape to attach a lid. The dimensions of each box were all integer multiples of inches.” Figure H.1: Example of folding a box. “You seem to have a very selective memory,” a now aggravated Fred complained. “Well, if it helps, I know that the three different box sizes were the three largest possible to make from those sheets of cardboard. I also know that we had between 20, 000 and 30, 000 books to ship. I think that should give you enough to determine the total number of books.”  “So let me get this straight. You’re giving me the dimensions of the sheets of cardboard, the fact that the box sizes are the three largest that can be made from them, the number of books left over after using each of the box sizes, and a range in which the number of books lies, correct?” said Fred, rubbing his increasingly aching head.  “That’s it,” confirmed Bill.  “Sounds like some grossly convoluted computer programming problem!”  “Yeah. Go figure?”

HBC223616[NOIP1998]幂次方,枚举HRemainderReminder题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)

标签: HBC223616[NOIP1998]幂次方 枚举HRemainderReminder题解