2022-2023年Bebras挑战练习题-Packing(包装)

A rectangular gift box is needed to hold 4 different sized chocolate bars. The biggest bar has 15 pieces.需要一个长方形的礼品盒来装 4 根不同尺寸的巧克力棒。最大的那根巧克力棒有 15 块。

 

Chocolate bars cannot be stacked on top of each other, and the gift box should have as few gaps as possible.巧克力棒不能叠放在一起,而且礼品盒内的空隙应尽可能少。

 

For example, if the chocolate bars are arranged as shown on the right, there are 7 gaps.例如,如果巧克力棒像右边那样排列,就有 7 个空隙。


Task 任务
:

Arrange the chocolate bars in a rectangle, with as few gaps as possible.把巧克力棒摆成一个长方形,尽量少留空隙。

(Drag the chocolate bars by the '+'. Rotate them by clicking the ↻. Press 'Save' when you are finished.)(通过“ ”拖动巧克力棒。点击“↻”旋转它们。完成后点击“保存”。)

2022-2023年Bebras挑战练习题-Packing(包装)

 

 

 

 

 

 

Explanation 解释

Answer:答案:

The best possible arrangements leave only 2 gaps.最好的安排也只能留出两个空位。

Explanation:解释:

One possible arrangement:一种可能的安排:

2022-2023年Bebras挑战练习题-Packing(包装)

This leaves us with 2 gaps in the top left of the rectangle.这在矩形的左上角给我们留下了两个空缺。

The number of chocolates pieces in all 4 bars put together is 12 + 15 + 6 + 5 = 38. A gift box that holds 38 pieces with 0 gaps must have dimensions 1 x 38 or 2 x 19. You will never be able to fit the 3 x 5 chocolate bars (or the 3 x 4 chocolate bar) in this gift box.将这 4 块巧克力合在一起,巧克力块的总数为 12 + 15 + 6 + 5 = 38 块。一个能容纳 38 块巧克力且没有空隙的礼盒,其尺寸必须是 1×38 或 2×19。你永远无法将 3×5 的巧克力块(或 3×4 的巧克力块)装进这个礼盒。

A gift box with 1 gap would hold 39 chocolate pieces. There are two possibilities, 1 x 39 (not possible) or 3 x 13. The two largest chocolate bars would take up 9 rows within such a gift box. The remaining 4 rows are not enough to place the smallest chocolate bar of size 1 x 5.一个有 1 个空隙的礼盒能装 39 块巧克力。有两种可能的排列方式,1×39(不可能)或 3×13。礼盒中最大的两块巧克力会占据 9 行。剩下的 4 行不足以放置最小的 1×5 的巧克力。

Hence, 2 gaps is the minimum we can have in any gift box, and we can achieve this as shown above.因此,任何礼品盒中至少会有 2 个空隙,而且如上图所示,我们能够达到这个最小值。

点击右侧文字,可获得更多在线练习题资源:>>> Bebras在线水平测试

Bebras新赛季备赛已开启,扫码领取Bebras真题资料⇓

欢迎咨询【Bebras专业辅导课程】

(Bebras每日一练部分展示)

在线客服
微信咨询