4. Determine all values of the real parameter $p$ such that the equation

$$
2017 \cdot|1-| 1-|1-x|||=2016 x+p
$$

has exactly three solutions in the set of real numbers.

The regional round of category B takes place

on Tuesday, April 11, 2017

so that it starts in the morning and the contestants have 4 hours of pure time to solve the problems. Allowed aids are writing and drawing supplies and school MF tables. Calculators, laptops, and any other electronic aids are not allowed. Contestants can earn 6 points for each problem; the logical correctness and completeness of the written solution are also evaluated. The point threshold $\mathrm{k}$ for determining successful solvers will be set centrally after evaluating the statistical point results from all regions. This information will be communicated to the students before the competition begins.
4. We will transform the equation into the form

$$
|1-| 1-|1-x|||=\frac{2016}{2017} x+\frac{p}{2017} .
$$

When solving, we will use the graphical method. The graph of the function $y=f(x)=|1-| 1-|1-x|||$ on the left side of equation (1) is a broken line with vertices at points $A=[-1,0], B=[0,1], C=[1,0]$, $D=[2,1]$ and $E=[3,0]$ (depicted in Fig. 2), consisting of four identical segments and two rays. The graph of the function $g$ on the right side of (1) is a line $y=k x+q$ with a slope $k=\frac{2016}{2017}$. Clearly, no intersection exists for $x_{0}=3$. For $x_{0}=3$, the line $\gamma$ intersects the graph of function $f$ at a single point $E$. For $x_{0}<3$, the line $\gamma$ intersects the interior of the ray of the graph of $f$ starting at point $E$ exactly once. For $x_{0}<-1$, the line $\gamma$ intersects the interior of the other ray of the graph of $f$ starting at point $A$, thus for such $x_{0}$ we already have two common points. For $x_{0} \in\langle-1,3)$, the line $\gamma$ intersects the broken line $A B C D E$ exactly twice, only if it passes through its vertices $D, C$ or $A$, and finally for $x_{0}<-1$ exactly once, only if it passes through vertex $B$.

This means that the graphs of both functions have exactly three common points only when the line $\gamma$ passes through one of the four points $A, B, C, D$ in Fig. 2. By substituting the coordinates of these four points into the equation

$$
y=k x+q=\frac{2016}{2017} x+\frac{p}{2017}
$$

of the line $\gamma$, we will determine the desired values of the parameter $p$.

Answer. The given equation has exactly three real solutions only when $p \in\{-2016,-2015, 2016,2017\}$.

Note. The broken line graph of the function $f$ divides the plane into two (unbounded) regions, and the line $\gamma$ for any value of the parameter $q$ intersects the region "above" the broken line in several segments, and these segments have an even number of common points with the boundary of that region, but some endpoints of two segments can coincide at the vertices of the broken line in the case of vertices. From this consideration, it follows that only those lines that pass through one of the vertices $A, B, C, D, E$ of the broken line can have an odd number of intersection points, and in the case of vertex $E$, only one.

For a complete solution, award 6 points, of which 3 points for drawing the graph of the function with three absolute values. The observation about the suitable relative positions of the broken line and the line can be considered obvious (as in the model solution), and thus award 2 points, and 1 point for calculating the values of $p$. If $k$ of them are missing from the list of suitable positions, deduct $k$ points if $k \leqq 2$; in the case of $k \geqq 3$, a maximum of 3 points can be awarded (for the correct graph according to the first sentence of the instructions).