- Time limit: 1.00 s
- Memory limit: 512 MB
What is the minimum number of moves after which the grid is empty?
The first input line has an integer $n$: the size of the grid. The rows and columns are numbered $1,2,\dots,n$.
After this, there are $n$ lines describing the grid. Each line has $n$ characters: each character is either
First print an integer $k$: the minimum number of moves. After this, print $k$ lines describing the moves.
On each line, first print $1$ (row) or $2$ (column), and then the number of a row or column. You can print any valid solution.
- $1 \le n \le 100$