Problem 8. Candies are in the shape of $1 \times 1 \times 1$ cubes. The teacher arranged them into a parallelepiped $3 \times 4 \times 5$ and offered the children to enjoy. In the first minute, Petya took one of the corner candies (see figure). Each subsequent minute, the children took all the candies that had a neighboring face with already missing candies (for example, in the second minute, they took 3 candies). How many minutes did it take for the children to take all the candies?

![](https://cdn.mathpix.com/cropped/2024_05_06_431cde69522d10d21992g-3.jpg?height=194&width=214&top_left_y=303&top_left_x=927)

Answer: It took 10 minutes.
Solution. Let Petya take a candy from the left upper front corner of the parallelepiped. We will number the vertical layers of the parallelepiped from left to right, the transverse layers of the parallelepiped from front to back, and the horizontal layers from top to bottom. For each cube, we will calculate the sum of the numbers of the layers in which it is located, and write this number on the cube. Note that on the first day, Petya will take the cube with the number 3. On the second day, the children will take all the cubes with the number 4, on the third day all the cubes with the number 5, and so on. The last they will take the far right bottom cube with the number 12, and this will happen on the tenth minute.