# PSE Advent Calendar 2022 (Day 2): Santa’s Magic Knapsack

This puzzle is part of the Puzzling Stack Exchange Advent Calendar 2022. The accepted answer to this question will be awarded a bounty worth 50 reputation.

< Previous Door Next Door >

Have you ever wondered how Santa fits all the presents in his bag? It’s simple – even though the bag has finite dimensions on the outside, the inside in fact expands endlessly in all directions, giving him infinite space to store all the presents he needs to deliver. To prevent Santa from getting lost in infinite space, the slots for presents and filling material must be carefully arranged in a repeatable pattern. Slots for presents are all rectangular shapes (which must be shaded in the grid), and each piece of filling material must be a non-rectangular shape, lest Santa mistake it for a present in his late night cookies-and-milk-induced sugar rush. Two present slots can touch at a corner, but they cannot share an edge; the same applies for pieces of filling material. Numbers in the grid indicate the size of the area (either present slot or piece of filling material) containing the number. An area is allowed to contain multiple numbers, and not all areas contain a number.

How should the contents of Santa’s bag be organised?

Oh, and no making infinitely large presents or fillings! You do not want to be the person telling an overworked elf that he'll be trying to fill a single slot until next Christmas. All areas in the finished grid (both shaded and unshaded) must be of finite size.

TL;DR Nikoli’s Choco Banana in an infinite grid.

Solve on Penpa+

• Great idea for a puzzle, love it :) One thing not clear to me from the Nikoli rules is whether an area can contain two identical numbers, or if each area can only contain one number. Do you have a stance on that? Thanks.
– Stiv
Dec 2, 2022 at 13:23
• @Stiv An area can contain multiple numbers. I'll clarify that in the rules.
– Jafe
Dec 2, 2022 at 13:27
• Ah, I now see that in the image at the top of the Nikoli instructions page they actually include an example of this in action; they just haven't mentioned it explicitly in the text. Thanks for clearing this up!
– Stiv
Dec 2, 2022 at 13:28
• @user39583 The grid's meant to wrap around horizontally and vertically. So what you see would be one unit in the repeating pattern.
– Jafe
Dec 2, 2022 at 14:44

The solution is the following:

Reasoning:

(Note: I use red for the sections that must be filler and green for the sections that must be presents.) Both 11s are too large to fit within the constraints of the 10*10 board as presents, and so they must be filler. This also means the 12 must be a present.

At the moment, the 12 has the least potential options, so I explored them. If it extends vertically (shown as grey or blue), the 8, 4, and 5 (outlined in black) will collide as filler, which is not permissible. Therefore, the 12 must extend around the left-right edge of the board (filled in green).

Just some cleanup. The 5, 8, and 11s fill the sides of the 12 present. 4 and another 8 must be a present, and the 4 only has one possible orientation, so that can be placed as well. A filler 8 can be placed along the top of the 4, and the 9 must be a present then as well.

The 8 present can now only be placed one way, and this allows us to connect and complete the 11 filler. Each of the cells outlined in black must be a present, but they must not connect, so the space between then must be filler.

The 9 cannot extend horizontally or it would force fillers 8 and 5 to connect (shown in grey). It also cannot form the square outlined in blue, as this would force the top fillers 8 and 7 to connect. Therefore, it must be placed as filled in green.

More cleanup. Filling in cells that can only be either filler or present solves most of this board.

Final steps! The 4 must be a present, and if placed as a square (outlined in black) it would collide with another present, so it must be placed as shown in green. The rest comes with relatively simple deduction.

Santa's knapsack can finally be filled with presents for all the good puzzlers of the world. A happy ending, if I do say so myself. : )

• Exactly right, nice job!
– Jafe
Dec 2, 2022 at 21:25
• Thank you. The puzzle was masterfully created and was a joy to solve. : ) Dec 3, 2022 at 22:52