{"raw_statement":[{"iden":"problem statement","content":"You are given a positive integer $D$.\nFind the minimum value of $|x^2+y^2-D|$ for non-negative integers $x$ and $y$."},{"iden":"constraints","content":"*   $1\\leq D \\leq 2\\times 10^{12}$\n*   All input values are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$D$"},{"iden":"sample input 1","content":"21"},{"iden":"sample output 1","content":"1\n\nFor $x=4$ and $y=2$, we have $|x^2+y^2-D| = |16+4-21|=1$.\nThere are no non-negative integers $x$ and $y$ such that $|x^2+y^2-D|=0$, so the answer is $1$."},{"iden":"sample input 2","content":"998244353"},{"iden":"sample output 2","content":"0"},{"iden":"sample input 3","content":"264428617"},{"iden":"sample output 3","content":"32"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}