## Task B-4.5.

The decimal representation of the number $N$ ends with 2022. If the last 4 digits are removed, the number that remains is a divisor of the number $N$. For example, if the last 4 digits of the number 22022 are removed, the number 2 remains, and it is a divisor of the number 22022. Determine the sum of the digits of all numbers $N$ with the described property.
## Solution.

The given number $N$ can be written as $N=m \cdot 10000 + 2022$.

Since $m$ must be a divisor of the number $N$, and from the previous expression, $m$ is clearly also a divisor of the number $m \cdot 10000$, we conclude that $m$ is a divisor of 2022.

The prime factorization of 2022 is $2022 = 2 \cdot 3 \cdot 337$.

Its divisors are $1, 2, 3, 6, 337, 674, 1011, 2022$, which are also all possible values of $m$.

Then the numbers $N$ are:

$12022, 22022, 32022, 62022, 3372022, 6742022, 10112022, 20222022$.

The sum of all digits we are looking for can be calculated as

$(2+0+2+2) \cdot 8 + (1+2+3+6+3+3+7+6+7+4+1+0+1+1+2+0+2+2) = 6 \cdot 8 + 51 = 99$.