B3. On the 1st level of the computer game Treasure, the player moves through an underground treasure chamber, which is composed of 13 octagonal and 12 square rooms. The only entrance and exit to the treasure chamber is in the central room, and in the remaining 24 rooms, there is one gold coin each (see the image). There is a passage between every two rooms, which closes immediately when the player steps through it. When the player exits a room where they have collected a gold coin, a new gold coin appears in that room. If the player gets trapped in the treasure chamber, they lose all the collected coins, and the game resets. What is the maximum number of gold coins the player can bring out of the treasure chamber?

![](https://cdn.mathpix.com/cropped/2024_06_07_95af3fbbcea2fb458cf3g-02.jpg?height=683&width=691&top_left_y=1877&top_left_x=1228)

67th Mathematical Competition for High School Students in Slovenia National Competition, April 22, 2023

# Tasks for 2nd Year

Time for solving: 180 minutes. Each task in section A has exactly one correct answer. In section A, we will award two points for the correct answer, and deduct one point for an incorrect answer. Write the answers for section A in the left column of the answer sheet, and leave the right column blank. The committee will consider only what is written on the answer sheets, marked with the contestant's code.
B3. Let's count how many doors each room with a coin has. We observe that in the maze, there are 12 rooms with 3 doors each, 4 rooms with 4 doors each, 4 rooms with 5 doors each, and 4 rooms with 8 doors each (we do not count the central room as it does not have a coin). A player can only go through a room with 3 doors once, otherwise, they would be trapped in it. This way, they collect 1 coin. A room with 4 doors can be visited twice, collecting 2 coins. A room with 5 doors can also be visited twice, collecting 2 coins. A room with 8 doors can be visited four times, collecting 4 coins. Therefore, the player can collect a maximum of \( n = 12 \cdot 1 + 4 \cdot 2 + 4 \cdot 2 + 4 \cdot 4 = 44 \) coins. We need to verify that there indeed exists a path that starts and ends in the central room and goes through a room with a coin 44 times. An example of such a path is shown in the figure.

![](https://cdn.mathpix.com/cropped/2024_06_07_95af3fbbcea2fb458cf3g-08.jpg?height=682&width=679&top_left_y=504&top_left_x=700)

Observation: Some rooms can only be visited once.

Find all rooms that can only be visited once. .1 point

Find all rooms that can be visited multiple times and determine the maximum number of coins that can be obtained from such a room. . .2 points

Find the upper bound of 44 coins. 1 point

Find an example of a path that collects 44 coins.

2 points

67th Mathematical Competition for High School Students in Slovenia National Competition, April 22, 2023

# Solutions to Problems for 2nd Year 

![](https://cdn.mathpix.com/cropped/2024_06_07_95af3fbbcea2fb458cf3g-09.jpg?height=139&width=234&top_left_y=473&top_left_x=928)