Sudoku Maker
Limits: 2 sec., 256 MiB
Once upon a time you saw an empty 9 by 9 grid, so you decided to fill it out with numbers so that it forms a solved sudoku puzzle. There is just one caveat - one cell must have a number \(Z\) placed in it. Sounds easy, right?
Input
The only line of input contains three numbers - number of the row and column where the number \(Z\) will have to be placed, and the number \(Z\) itself. Indices start from 1.
Output
In nine rows output nine space-separated numbers - the solved sudoku puzzle that follows the specifications.
Constraints
\(1 \leq Z \leq 9\)
Samples
| Input (stdin) | Output (stdout) |
|---|---|
| 1 1 7 | 7 5 6 3 1 9 2 4 8 2 9 4 6 7 8 1 3 5 3 1 8 2 4 5 6 9 7 1 4 2 8 3 6 7 5 9 6 3 9 1 5 7 8 2 4 5 8 7 4 9 2 3 1 6 4 7 1 9 6 3 5 8 2 9 2 5 7 8 1 4 6 3 8 6 3 5 2 4 9 7 1 |
Notes
In the sudoku puzzle you are placing numbers 1 through 9 into a 9x9 grid. Each row and each column must contain each of the numbers from 1 to 9 exactly once. Additionally, the nine 3x3 subgrids should each contain each of 1 to 9 exactly once as well. To get these 9 subgrids, imagine splitting the board after the 3rd and 6th row and after the 3rd and 6th column. As a result the board will split into 9 3x3 subgrids.
If the above isn’t clear, refer to Wikipidea for visual illustration (if you’re participating online), or ask organizers for the rules printout (if you’re participating onsite).
Submit a solution
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|