5. Two players are playing a game. The number 2022 is written on the board. In one move, a player must replace the current number $a$ on the board with another (different from $a$), obtained as a result of one of the three operations:
1) Subtract 3;
2) Subtract the remainder of dividing $a-2$ by 7 from $a$;
3) Subtract the remainder of dividing $5a-1$ by 7 from $a$.

The player who, after their move, first produces a negative number loses. Which player can win, regardless of the opponent's actions? (20 points)
Solution: A draw is impossible, as per the task requirements, the number must change after each move, which means the number on the board will decrease with each move and will eventually become negative. The player who receives the number 2018 on their turn either has a winning strategy or their opponent does. The first player can influence who gets the number 2018, which means he also has a winning strategy. Let's prove this. If the first player wants the opponent to receive the number 2018 at the beginning of their turn, he makes the second move: 2022 has a remainder of 6 when divided by 7, which means the number \(a-2\) has a remainder of 4 when divided by 7, so the result of the second move will be 2018.

If the first player wants to start his turn with the number 2018, his first move is the third action: 2022 has a remainder of 6 when divided by 7, so \(5a-1 \equiv_{7} 5 \cdot 6-1=29 \equiv_{7} 1\), which means the result of the third action will be 2021. The number 2021 has a remainder of 5 when divided by 7, so for \(a=2021\) the congruences \(5a-1 \equiv_{7} a-2 \equiv_{7} 3\) hold, which means the opponent will get 2018 no matter what move they make. Therefore, the first player has a winning strategy.

## Answer: the first player

## Problem 1

Grading Criteria

| Correct Example | 20 points |
| :--- | :--- |
| Incorrect example or its absence | 0 points |

## Problem 2

| Full Solution | 20 points |
| :--- | :--- |
| The cosine of the angle is calculated incorrectly due to an incorrect cosine theorem, with the cosine of the angle found incorrectly up to the sign | 12 points |
| The correct solution relies on an unproven fact that three points lie on the same line | 12 points |
| The correct answer is expressed in terms of trigonometric functions but not calculated in degrees | 5 points |
| Incorrect solution or its absence | 0 points |

## Problem 3

| Full Solution | 20 points |
| :--- | :--- |
| One extra case is calculated in an otherwise correct solution | 18 points |
| One minute of suitable time is lost in an otherwise correct solution | 18 points |
| The case with 9 minutes is lost | 15 points |
| The number of suitable minutes in one group, as indicated in the author's solution, is calculated incorrectly | 15 points |
| The problem is correctly solved for a scenario where the number of segments used to display time is less than one minute | 15 points |
| The total time is divided into groups as indicated in the author's solution, and the time in two of them is correctly calculated, while logical errors are made in the calculation of the other two | 12 points |
| The number of segments in the hours is not taken into account, resulting in lost cases with 59 minutes | 10 points |
| Two groups of numbers, as indicated in the author's solution, are correctly calculated without the specified division of the entire time into groups | 8 points |
| One group of numbers, as indicated in the author's solution, or a significant part of it, is correctly calculated without the specified division of the entire time into groups | 5 points |
| Arithmetic errors in calculating the numbers in the groups | -2 points for each |
| Incorrect solution or its absence | 0 points |

## Problem 4

| A correct example of how the sums could match, with an indication of how exactly the numbers should be changed | 20 points |
| :--- | :--- |
| Incorrect examples of matching sums or a proof that the sums could not match | 0 points |

## Problem 5

| Full Solution | 20 points |
| :--- | :--- |
| The pattern of winning and losing positions is indicated but not proven | 7 points |
| It is proven that the first player can always make a move to get a number with a remainder of 2 when divided by 7 | 7 points |
| The idea of arranging winning and losing positions is present, but the positions are arranged incorrectly | 3 points |
| Unjustified or incorrect strategies for either player | 0 points |