8.1. The numbers from 5 to 18 were written in the cells of the figure shown in the image without repetition. Then, all possible values of the sums in the $1 \times 3$ rectangles were calculated and added together. It turned out that the arrangement of the numbers gives the maximum value of this sum. What can the sum of the numbers in the highlighted cells be?

![](https://cdn.mathpix.com/cropped/2024_05_06_c4a05b5b9b4d29b3aeb4g-2.jpg?height=623&width=411&top_left_y=1342&top_left_x=183)
Answer: 50, 51

Solution. Let's consider how many different rectangles each cell is in. The shaded cells (from top to bottom) are repeated 3, 4, 6 times. And the cell below will also be repeated 3 times. Thus, to arrange the numbers in the required manner, we need to place 18 and 17 in the cells that appear the most frequently - 6 and 4 times, and 16 and 15 in the cells that appear 3 times. We understand that there are two options - when the third highlighted cell contains 16 or 15. We get \(18 + 17 + 16 = 51\) or \(18 + 17 + 15 = 50\).

![](https://cdn.mathpix.com/cropped/2024_05_06_c4a05b5b9b4d29b3aeb4g-2.jpg?height=457&width=303&top_left_y=2344&top_left_x=160)