{"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\"\u003eAfter hh has learned how to play Nim game, he begins to try another coin game which seems much easier.\u003cbr\u003e\u003ccenter\u003e\u003cimg style\u003d\"max-width:100%;\" src\u003d\"CDN_BASE_URL/b7edb3d2aa7af3b16bf9fd6a07da39db?v\u003d1714944744\"\u003e\u003c/center\u003e\u003cbr\u003eThe game goes like this: \u003cbr\u003eTwo players start the game with a circle of n coins. \u003cbr\u003eThey take coins from the circle in turn and every time they could take 1~K continuous coins. \u003cbr\u003e(imagining that ten coins numbered from 1 to 10 and K equal to 3, since 1 and 10 are continuous, you could take away the continuous 10 , 1 , 2 , but if 2 was taken away, you couldn\u0027t take 1, 3, 4, because 1 and 3 aren\u0027t continuous)\u003cbr\u003eThe player who takes the last coin wins the game. \u003cbr\u003eSuppose that those two players always take the best moves and never make mistakes. \u003cbr\u003eYour job is to find out who will definitely win the game.\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line is a number T(1\u0026lt;\u003dT\u0026lt;\u003d100), represents the number of case. The next T blocks follow each indicates a case.\u003cbr\u003eEach case contains two integers N(3\u0026lt;\u003dN\u0026lt;\u003d10\u003csup\u003e9\u003c/sup\u003e,1\u0026lt;\u003dK\u0026lt;\u003d10)."}},{"title":"Output","value":{"format":"HTML","content":"For each case, output the number of case and the winner \"first\" or \"second\".(as shown in the sample output)"}},{"title":"Sample","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\u003e2\r\n3 1\r\n3 2\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase 1: first\r\nCase 2: second\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}