{"trustable":true,"prependHtml":"\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 async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003e一只青蛙刚学会了一些数论知识,迫不及待地想要向它的女朋友展示自己的能力。\u003cbr\u003e\u003cbr\u003e现在这只青蛙坐在一个无限行和列的网格地图上。行从底部开始编号,列也是如此。一开始,青蛙坐在网格$(s_x, s_y)$上,并开始了它的旅程。\u003cbr\u003e\u003cbr\u003e为了向女朋友展示自己在数学方面的才华,它使用了一种特殊的跳跃方式。如果青蛙当前在网格$(x, y)$上,首先,它会找到能同时被$x$和$y$整除的最小的$z$,然后向上或向右跳$z$步。因此,下一个可能的网格将是$(x + z, y)$或$(x, y + z)$。\u003cbr\u003e\u003cbr\u003e经过有限次数的跳跃(也许是零次),最终它停在了网格$(e_x, e_y)$。然而,它太累了,忘记了自己起始网格的位置!\u003cbr\u003e\u003cbr\u003e逐个检查每个网格将太愚蠢了,所以请告诉青蛙可以到达$(e_x, e_y)$的可能起始网格数量!\u003c/div\u003e"}},{"title":"输入","value":{"format":"HTML","content":"第一行包含一个整数$T$,表示测试用例的数量。\u003cbr\u003e\u003cbr\u003e每个测试用例包含两个整数$e_x$和$e_y$,即目标网格。\u003cbr\u003e\u003cbr\u003e$\\cdot$ $1 \\leq T \\leq 1000$。\u003cbr\u003e$\\cdot$ $1 \\leq e_x, e_y \\leq 10^9$。"}},{"title":"输出","value":{"format":"HTML","content":"对于每个测试用例,你应该输出\"\u003cb\u003eCase #x: y\u003c/b\u003e\",其中$x$表示案例编号,从$1$开始计数,$y$是可能的起始网格数量。\u003cbr\u003e"}},{"title":"示例","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3\r\n6 10\r\n6 8\r\n2 8\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase #1: 1\r\nCase #2: 2\r\nCase #3: 3\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}}]}