{"raw_statement":[{"iden":"problem statement","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."},{"iden":"constraints","content":"*   $-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."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$X$ $K$ $D$"},{"iden":"sample input 1","content":"6 2 4"},{"iden":"sample output 1","content":"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."},{"iden":"sample input 2","content":"7 4 3"},{"iden":"sample output 2","content":"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."},{"iden":"sample input 3","content":"10 1 2"},{"iden":"sample output 3","content":"8"},{"iden":"sample input 4","content":"1000000000000000 1000000000000000 1000000000000000"},{"iden":"sample output 4","content":"1000000000000000\n\nThe answer can be enormous."}],"translated_statement":null,"sample_group":[],"show_order":["render_html"],"formal_statement":null,"simple_statement":null,"has_page_source":true}