{"trustable":true,"prependHtml":"\u003clink rel\u003dstylesheet href\u003d\u0027https://static.toph.co/css/katex.css\u0027\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eIn the year 2020, Alice and Bob will land on Mars just to play a game that will be broadcasted live for the humans on earth. The game is described below:\u003c/p\u003e\u003cp\u003eThere will be a 2-dimensional grid. The columns of this grid are numbered from left to right starting with index 1 and rows are number from top to bottom starting with index 1. There are \u003cspan class\u003d\"katex\"\u003e\u003cspan class\u003d\"katex-mathml\"\u003e\u003cmath xmlns\u003d\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eN\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding\u003d\"application/x-tex\"\u003eN\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\u003cspan class\u003d\"katex-html\" aria-hidden\u003d\"true\"\u003e\u003cspan class\u003d\"base\"\u003e\u003cspan class\u003d\"strut\" style\u003d\"height:.68333em;vertical-align:0\"\u003e\u003c/span\u003e\u003cspan class\u003d\"mord mathnormal\" style\u003d\"margin-right:.10903em\"\u003eN\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e coins. Each coin is placed exactly on one cell of the grid. Each cell may contain zero, one or multiple coins. In each turn, one can perform one of the following moves:\u003c/p\u003e\u003cp\u003ei. Take away any single coin from the grid permanently. (always applicable for the coins which are present on the grid.)\u003c/p\u003e\u003cp\u003eii. Take away any single coin from its current location and put it back to any cell on the left of its current location of the same row. (not applicable for the coins which are on the 1st column)\u003c/p\u003e\u003cp\u003eiii. Take away any single coin from its current location and put it back to any cell on the up of its current location of the same column. (not applicable for the coins which are on the 1st row)\u003c/p\u003e\u003cp\u003eAlice and Bob will turn alternatively. Both of them will play optimally to win the game. Alice will move first. The person who will make the last move will be the winner of the game. Now, you have to determine who will win the game. If Alice is the winner, you have to calculate how many ways she can perform her first move that leads the game to her winning.\u003c/p\u003e\u003ch2\u003eInput\u003c/h2\u003e\u003cp\u003eFirst line of inputs contains the number of test case \u003cspan class\u003d\"katex\"\u003e\u003cspan class\u003d\"katex-mathml\"\u003e\u003cmath xmlns\u003d\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eT\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding\u003d\"application/x-tex\"\u003eT\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\u003cspan class\u003d\"katex-html\" aria-hidden\u003d\"true\"\u003e\u003cspan class\u003d\"base\"\u003e\u003cspan class\u003d\"strut\" style\u003d\"height:.68333em;vertical-align:0\"\u003e\u003c/span\u003e\u003cspan class\u003d\"mord mathnormal\" style\u003d\"margin-right:.13889em\"\u003eT\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e (\u003cspan class\u003d\"katex\"\u003e\u003cspan class\u003d\"katex-mathml\"\u003e\u003cmath xmlns\u003d\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmo\u003e≤\u003c/mo\u003e\u003cmi\u003eT\u003c/mi\u003e\u003cmo\u003e≤\u003c/mo\u003e\u003cmn\u003e100\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding\u003d\"application/x-tex\"\u003e1 ≤ T ≤ 100\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\u003cspan class\u003d\"katex-html\" aria-hidden\u003d\"true\"\u003e\u003cspan class\u003d\"base\"\u003e\u003cspan class\u003d\"strut\" style\u003d\"height:.78041em;vertical-align:-.13597em\"\u003e\u003c/span\u003e\u003cspan class\u003d\"mord\"\u003e1\u003c/span\u003e\u003cspan class\u003d\"mspace\" style\u003d\"margin-right:.2777777777777778em\"\u003e\u003c/span\u003e\u003cspan class\u003d\"mrel\"\u003e≤\u003c/span\u003e\u003cspan class\u003d\"mspace\" style\u003d\"margin-right:.2777777777777778em\"\u003e\u003c/span\u003e\u003c/span\u003e\u003cspan class\u003d\"base\"\u003e\u003cspan class\u003d\"strut\" style\u003d\"height:.8193em;vertical-align:-.13597em\"\u003e\u003c/span\u003e\u003cspan class\u003d\"mord mathnormal\" style\u003d\"margin-right:.13889em\"\u003eT\u003c/span\u003e\u003cspan class\u003d\"mspace\" style\u003d\"margin-right:.2777777777777778em\"\u003e\u003c/span\u003e\u003cspan class\u003d\"mrel\"\u003e≤\u003c/span\u003e\u003cspan class\u003d\"mspace\" style\u003d\"margin-right:.2777777777777778em\"\u003e\u003c/span\u003e\u003c/span\u003e\u003cspan class\u003d\"base\"\u003e\u003cspan class\u003d\"strut\" style\u003d\"height:.64444em;vertical-align:0\"\u003e\u003c/span\u003e\u003cspan class\u003d\"mord\"\u003e100\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e). In the first line of each test case, given the value of \u003cspan class\u003d\"katex\"\u003e\u003cspan class\u003d\"katex-mathml\"\u003e\u003cmath xmlns\u003d\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eN\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding\u003d\"application/x-tex\"\u003eN\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\u003cspan class\u003d\"katex-html\" aria-hidden\u003d\"true\"\u003e\u003cspan class\u003d\"base\"\u003e\u003cspan class\u003d\"strut\" style\u003d\"height:.68333em;vertical-align:0\"\u003e\u003c/span\u003e\u003cspan class\u003d\"mord mathnormal\" style\u003d\"margin-right:.10903em\"\u003eN\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e (\u003cspan class\u003d\"katex\"\u003e\u003cspan class\u003d\"katex-mathml\"\u003e\u003cmath xmlns\u003d\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmo\u003e≤\u003c/mo\u003e\u003cmi\u003eN\u003c/mi\u003e\u003cmo\u003e≤\u003c/mo\u003e\u003cmn\u003e10000\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding\u003d\"application/x-tex\"\u003e1 ≤ N ≤ 10000\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\u003cspan class\u003d\"katex-html\" aria-hidden\u003d\"true\"\u003e\u003cspan class\u003d\"base\"\u003e\u003cspan class\u003d\"strut\" style\u003d\"height:.78041em;vertical-align:-.13597em\"\u003e\u003c/span\u003e\u003cspan class\u003d\"mord\"\u003e1\u003c/span\u003e\u003cspan class\u003d\"mspace\" style\u003d\"margin-right:.2777777777777778em\"\u003e\u003c/span\u003e\u003cspan class\u003d\"mrel\"\u003e≤\u003c/span\u003e\u003cspan class\u003d\"mspace\" style\u003d\"margin-right:.2777777777777778em\"\u003e\u003c/span\u003e\u003c/span\u003e\u003cspan class\u003d\"base\"\u003e\u003cspan class\u003d\"strut\" style\u003d\"height:.8193em;vertical-align:-.13597em\"\u003e\u003c/span\u003e\u003cspan class\u003d\"mord mathnormal\" style\u003d\"margin-right:.10903em\"\u003eN\u003c/span\u003e\u003cspan class\u003d\"mspace\" style\u003d\"margin-right:.2777777777777778em\"\u003e\u003c/span\u003e\u003cspan class\u003d\"mrel\"\u003e≤\u003c/span\u003e\u003cspan class\u003d\"mspace\" style\u003d\"margin-right:.2777777777777778em\"\u003e\u003c/span\u003e\u003c/span\u003e\u003cspan class\u003d\"base\"\u003e\u003cspan class\u003d\"strut\" style\u003d\"height:.64444em;vertical-align:0\"\u003e\u003c/span\u003e\u003cspan class\u003d\"mord\"\u003e10000\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e) and next N lines will describe the location of each coin as (x, y) on the gird where x is the row number and y is the column number of the coin. (\u003cspan class\u003d\"katex\"\u003e\u003cspan class\u003d\"katex-mathml\"\u003e\u003cmath xmlns\u003d\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmo\u003e≤\u003c/mo\u003e\u003cmi\u003ex\u003c/mi\u003e\u003cmo separator\u003d\"true\"\u003e,\u003c/mo\u003e\u003cmi\u003ey\u003c/mi\u003e\u003cmo\u003e≤\u003c/mo\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmsup\u003e\u003cmn\u003e0\u003c/mn\u003e\u003cmn\u003e9\u003c/mn\u003e\u003c/msup\u003e\u003c/mrow\u003e\u003cannotation encoding\u003d\"application/x-tex\"\u003e1 ≤ x, y ≤ 10^9\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\u003cspan class\u003d\"katex-html\" aria-hidden\u003d\"true\"\u003e\u003cspan class\u003d\"base\"\u003e\u003cspan class\u003d\"strut\" style\u003d\"height:.78041em;vertical-align:-.13597em\"\u003e\u003c/span\u003e\u003cspan class\u003d\"mord\"\u003e1\u003c/span\u003e\u003cspan class\u003d\"mspace\" style\u003d\"margin-right:.2777777777777778em\"\u003e\u003c/span\u003e\u003cspan class\u003d\"mrel\"\u003e≤\u003c/span\u003e\u003cspan class\u003d\"mspace\" style\u003d\"margin-right:.2777777777777778em\"\u003e\u003c/span\u003e\u003c/span\u003e\u003cspan class\u003d\"base\"\u003e\u003cspan class\u003d\"strut\" style\u003d\"height:.8304100000000001em;vertical-align:-.19444em\"\u003e\u003c/span\u003e\u003cspan class\u003d\"mord mathnormal\"\u003ex\u003c/span\u003e\u003cspan class\u003d\"mpunct\"\u003e,\u003c/span\u003e\u003cspan class\u003d\"mspace\" style\u003d\"margin-right:.16666666666666666em\"\u003e\u003c/span\u003e\u003cspan class\u003d\"mord mathnormal\" style\u003d\"margin-right:.03588em\"\u003ey\u003c/span\u003e\u003cspan class\u003d\"mspace\" style\u003d\"margin-right:.2777777777777778em\"\u003e\u003c/span\u003e\u003cspan class\u003d\"mrel\"\u003e≤\u003c/span\u003e\u003cspan class\u003d\"mspace\" style\u003d\"margin-right:.2777777777777778em\"\u003e\u003c/span\u003e\u003c/span\u003e\u003cspan class\u003d\"base\"\u003e\u003cspan class\u003d\"strut\" style\u003d\"height:.8141079999999999em;vertical-align:0\"\u003e\u003c/span\u003e\u003cspan class\u003d\"mord\"\u003e1\u003c/span\u003e\u003cspan class\u003d\"mord\"\u003e\u003cspan class\u003d\"mord\"\u003e0\u003c/span\u003e\u003cspan class\u003d\"msupsub\"\u003e\u003cspan class\u003d\"vlist-t\"\u003e\u003cspan class\u003d\"vlist-r\"\u003e\u003cspan class\u003d\"vlist\" style\u003d\"height:.8141079999999999em\"\u003e\u003cspan style\u003d\"top:-3.063em;margin-right:.05em\"\u003e\u003cspan class\u003d\"pstrut\" style\u003d\"height:2.7em\"\u003e\u003c/span\u003e\u003cspan class\u003d\"sizing reset-size6 size3 mtight\"\u003e\u003cspan class\u003d\"mord mtight\"\u003e9\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e)\u003c/p\u003e\u003ch2\u003eOutput\u003c/h2\u003e\u003cp\u003eFor each test case, output a single line like \"Case X: Y\" without the quotes where X is the test case number and Y is the name of the winner. If Alice wins the game, print the number of ways Alice can perform her first move, in the next line.\u003c/p\u003e\u003ch2\u003eSample\u003c/h2\u003e\u003cdiv class\u003d\"tablebox\"\u003e\u003ctable class\u003d\"-samples vjudge_sample\"\u003e\u003cthead\u003e\u003ctr\u003e\u003cth style\u003d\"width:50%\"\u003eInput\u003c/th\u003e\u003cth style\u003d\"width:50%\"\u003eOutput\u003c/th\u003e\u003c/tr\u003e\u003c/thead\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd class\u003d\"pre copywrap\"\u003e\u003cpre id\u003d\"preSample0Input\"\u003e2\n2\n1 2\n2 1\n2\n1 1\n2 1\n\u003c/pre\u003e\u003c/td\u003e\u003ctd class\u003d\"pre copywrap\"\u003e\u003cpre id\u003d\"preSample0Output\"\u003eCase 1: Bob\nCase 2: Alice\n1\n\u003c/pre\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003c/div\u003e\u003cbr\u003e"}}]}