{"problem":{"name":"Walking Takahashi","description":{"content":"Takahashi, who lives on the number line, is now at coordinate $X$. He will make exactly $K$ moves of distance $D$ in the positive or negative direction. More specifically, in one move, he can go from ","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc175_c"},"statements":[{"statement_type":"Markdown","content":"Takahashi, who lives on the number line, is now at coordinate $X$. He will make exactly $K$ moves of distance $D$ in the positive or negative direction.\nMore specifically, in one move, he can go from coordinate $x$ to $x + D$ or $x - D$.\nHe wants to make $K$ moves so that the absolute value of the coordinate of the destination will be the smallest possible.\nFind the minimum possible absolute value of the coordinate of the destination.\n\n## Constraints\n\n*   $-10^{15} \\leq X \\leq 10^{15}$\n*   $1 \\leq K \\leq 10^{15}$\n*   $1 \\leq D \\leq 10^{15}$\n*   All values in input are integers.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$X$ $K$ $D$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc175_c","tags":[],"sample_group":[["6 2 4","2\n\nTakahashi is now at coordinate $6$. It is optimal to make the following moves:\n\n*   Move from coordinate $6$ to ($6 - 4 =$) $2$.\n*   Move from coordinate $2$ to ($2 - 4 =$) $-2$.\n\nHere, the absolute value of the coordinate of the destination is $2$, and we cannot make it smaller."],["7 4 3","1\n\nTakahashi is now at coordinate $7$. It is optimal to make, for example, the following moves:\n\n*   Move from coordinate $7$ to $4$.\n*   Move from coordinate $4$ to $7$.\n*   Move from coordinate $7$ to $4$.\n*   Move from coordinate $4$ to $1$.\n\nHere, the absolute value of the coordinate of the destination is $1$, and we cannot make it smaller."],["10 1 2","8"],["1000000000000000 1000000000000000 1000000000000000","1000000000000000\n\nThe answer can be enormous."]],"created_at":"2026-03-03 11:01:14"}}