Math Test#11713

Math Test (Editorial)

Problem Author:

Oleksandr Tymkovych

Editorial by:

Oleksandr Tymkovych

For notice that ||x-y|-y|=|y-x-y|=x, which means that after two operations hasn't changed. In such case, the answer is \begin{cases} x& \text{if } k \text{ is even}, \\ y-x & \text{if } k \text{ is odd}. \end{cases}

For we may reduce the problem by subtracting from a fixed number of times.