{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"在击剑界,堆堆是一个不败的传说。\n\u003cbr\u003e\n但是就是这样一个超强的人,却十分的慎重。\n\u003cbr\u003e\n对于任何一个对手,他都会使用自己的绝技。\n\u003cbr\u003e\n但是这个绝技的使用条件十分苛刻。\n\u003cbr\u003e\n如图,假设堆堆与对手处于一个整数轴的正向上,对手位于A点,堆堆位于B点,需要满足| |OB| - |AB| |\u003dk。\n\u003cbr\u003e\n但是堆堆位于的B点可能不一定存在,这时堆堆就会使用他的另外一个技能乾坤大挪移,来让他的敌人向左或者向右移动一格。\n\u003cbr\u003e\n因为堆堆潜心修炼,无心计算他需要使用乾坤大挪移的次数,所以你能帮他计算最少需要使用的次数吗?\n \u003cimg class\u003d\"tex-graphics\" src\u003d\"CDN_BASE_URL/a7d9c5826209b403e8f0de8fbd90ecf9?v\u003d1602298477\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e \u003cspan class\u003d\"tex-font-size-small\"\u003e\n\n"}},{"title":"Input","value":{"format":"HTML","content":"第一行输入一个整数T,代表T个样例(1\u003c\u003dT\u003c\u003d6000)。\n\u003cbr\u003e\n每个样例输入两个整数,n和k,n代表A点的坐标,k的意思见题目描述。(0\u003c\u003dn,k\u003c\u003d1e6)。"}},{"title":"Output","value":{"format":"HTML","content":"对于每个样例,输出最少需要使用技能的次数。"}},{"title":"Example","value":{"format":"HTML","content":"\u003cdiv class\u003d\"sample-test\"\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e6\n4 0\n5 8\n0 1000000\n0 0\n1 0\n1000000 1000000\n\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003e0\n3\n1000000\n0\n1\n0\n\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}}]}