{"trustable":true,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n div.illustration {\n float: right;\n padding-left: 20px;\n }\n div.illustration .illustration {\n width: 100%;\n border-radius: 4px;\n }\n pre {\n display: block;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n color: #333;\n word-break: break-all;\n word-wrap: break-word;\n }\n\u003c/style\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\[\u0027, right: \u0027\\\\]\u0027, display: true}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\n \u003cdiv style\u003d\"width:30.00%\" class\u003d\"illustration\"\u003e\n \u003cimg src\u003d\"CDN_BASE_URL/1560f01865b835fdef0d390b700de6af?v\u003d1714341433\" alt\u003d\"/problems/superdoku/file/statement/en/img-0001.png\" class\u003d\"illustration\"\u003e\n \n \u003c/div\u003e\n \u003cp\u003eAlice and Bob are big fans of math. In particular, they are\n very excited about playing games that are related to numbers.\n Whenever they see a puzzle like Sudoku, they cannot stop\n themselves from solving it. The objective of Sudoku is to fill\n a \u003cspan class\u003d\"tex2jax_process\"\u003e$9\\times 9$\u003c/span\u003e grid with\n digits so that each column, each row, and each of the nine\n (\u003cspan class\u003d\"tex2jax_process\"\u003e$3\\times 3$\u003c/span\u003e) subgrids\n that compose the grid (also called “boxes”, “blocks”, or\n “regions”) contains all of the digits from \u003cspan class\u003d\"tex2jax_process\"\u003e$1$\u003c/span\u003e to \u003cspan class\u003d\"tex2jax_process\"\u003e$9$\u003c/span\u003e. The puzzle setter provides a\n partially completed grid, which for a well-posed puzzle has a\n single solution.\u003c/p\u003e\n \u003cp\u003eAfter many years of solving Sudoku problems, Alice and Bob\n are tired of Sudoku. They have been trying to develop a harder\n variation of Sudoku, which they are calling Superdoku. In\n Superdoku, the grid is bigger – \u003cspan class\u003d\"tex2jax_process\"\u003e$n\\times n$\u003c/span\u003e instead of just\n \u003cspan class\u003d\"tex2jax_process\"\u003e$9\\times 9$\u003c/span\u003e. However, the\n “block” constraints are impossible to formulate when there are\n no further constraints on \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e. Therefore, there are no block\n constraints in Superdoku. Instead, the goal is simply to make\n sure that each column and each row in the grid contains all of\n the integers from \u003cspan class\u003d\"tex2jax_process\"\u003e$1$\u003c/span\u003e to\n \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e. After playing for a\n while in the standard way (where any of the grid cells may have\n previously been filled in), they decide that the game is too\n difficult and they want to simplify it. Therefore, they decide\n to make the initial grid further constrained. They constrain\n the board by filling in the first \u003cspan class\u003d\"tex2jax_process\"\u003e$k$\u003c/span\u003e rows completely.\u003c/p\u003e\n \u003cp\u003eAlice and Bob both believe that Superdoku is solvable.\n However, since \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e could\n be very big, it may still take a long time to figure out a\n solution. They don’t want to spend too much time on this single\n game, so they are asking for your help!\u003c/p\u003e\n \u003ch2\u003eInput\u003c/h2\u003e\n \u003cp\u003eThe input consists of a single test case. The first line\n lists two space-separated integers \u003cspan class\u003d\"tex2jax_process\"\u003e$1 \\le n \\le 100$\u003c/span\u003e and \u003cspan class\u003d\"tex2jax_process\"\u003e$0 \\le k \\le n$\u003c/span\u003e, denoting the size of\n the grid \u003cspan class\u003d\"tex2jax_process\"\u003e$(n\\times n)$\u003c/span\u003e and\n the number of rows \u003cspan class\u003d\"tex2jax_process\"\u003e$k$\u003c/span\u003e\n that are already filled in. Each of the following \u003cspan class\u003d\"tex2jax_process\"\u003e$k$\u003c/span\u003e lines contains \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e space-separated integers, denoting\n the first \u003cspan class\u003d\"tex2jax_process\"\u003e$k$\u003c/span\u003e given rows.\n All integers in these \u003cspan class\u003d\"tex2jax_process\"\u003e$k$\u003c/span\u003e\n lines are between \u003cspan class\u003d\"tex2jax_process\"\u003e$1$\u003c/span\u003e and\n \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e.\u003c/p\u003e\n \u003ch2\u003eOutput\u003c/h2\u003e\n \u003cp\u003eOutput either “\u003ctt class\u003d\"ttfamily\"\u003eyes\u003c/tt\u003e” or “\u003ctt class\u003d\"ttfamily\"\u003eno\u003c/tt\u003e” on the first line, indicating if there is a\n solution. If there is no solution, do not output anything more.\n If there is a solution, output \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e more lines, each containing\n \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e space-separated\n integers, representing a solution. If there are multiple\n solutions, output any one of them.\u003c/p\u003e\n \u003ch2\u003eSample 1\u003c/h2\u003e\u003cbody\u003e\u003ctable class\u003d\"vjudge_sample\"\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\u003e4 2\n1 2 3 4\n2 3 4 1\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eyes\n1 2 3 4 \n2 3 4 1 \n3 4 1 2 \n4 1 2 3 \n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/body\u003e\n \u003ch2\u003eSample 2\u003c/h2\u003e\u003cbody\u003e\u003ctable class\u003d\"vjudge_sample\"\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\u003e4 2\n1 2 3 4\n2 2 2 2\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eno\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/body\u003e\n "}}]}