, so the sum of the numbers on opposite faces of the die is 7. Given a 50×50 chessboard, each cell is equal to the face of the die. The die rolls from the bottom-left corner of the board to the top-right corner. Each time it rolls, it tumbles over one of its edges to an adjacent cell, and it is only allowed to move to the right or up (it cannot move to the left or down). On each cell along the path of the die, there is a number indicating the face that was in contact with that cell. What is the maximum value that the sum of all the numbers can take? What is the minimum value it can take?

#
Let's assume we rolled a cube from the bottom left corner of the board to the top right. We will consider that after each roll over an edge, the number on the face of the cube that was touching the cell is printed on that cell. The printed numbers $a_{1}, \ldots, a_{99}$ will be written in a row, and their sum will be denoted by $S$.

If the numbers on all faces of the cube are replaced by the average number 3.5, then the sum of the printed numbers will be $s = 3.5 \cdot 99 = 346.5$.

Let's estimate the value of $|S-s|$. Since the numbers $a$ and $7-a$ are on opposite faces of the cube, it is not difficult to understand that between any two consecutive occurrences of the number $a$, there must be a number $7-a$. Therefore, for each $1 \leq a \leq 3$, there are three possible situations:

1) The number of $a$'s in the sequence is the same as the number of $7-a$'s;
2) The number of $a$'s is exactly one more than the number of $7-a$'s;
3) The number of $a$'s is exactly one less than the number of $7-a$'s.

In case 1), replacing all $a$'s and $7-a$'s with 3.5 will not change their contribution to $S$. In cases 2) and 3), such a replacement will increase or decrease $S$ by $3.5 - a$. As a result, the entire sum will increase or decrease by at most $(3.5-1) + (3.5-2) + (3.5-3) = 4.5$.

Thus, $342 = s - 4.5 \leq S \leq s + 4.5 = 351$.

The values $S = 351$ and $S = 342$ are indeed achievable if the cube is rolled as shown in the figures.
![](https://cdn.mathpix.com/cropped/2024_05_06_dd7345f2b5ef58b5189dg-05.jpg?height=752&width=1532&top_left_y=1&top_left_x=272)

## Answer

$351, 342$.