영어 원문입니다. 원문의 수식·표를 글자로 옮겨 모양이 다를 수 있습니다. 정확한 내용은 원문 페이지에서 확인하세요. 원문 페이지 열기 (새 창)
시간 제한 1초 · 메모리 제한 512 MB
Problem
There is an n × n grid whose each square is empty or has a coin. On each move, you can remove all coins in a row or column.
What is the minimum number of moves after which the grid is empty?
Input
The first input line has an integer n: the size of the grid. The rows and columns are numbered 1,2,…,n.
After this, there are n lines describing the grid. Each line has n characters: each character is either . (empty) or o (coin).
Output
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.
Constraints
- 1 ≤ n ≤ 100
예제
예제 1
3 ..o o.o ...
2 1 2 2 3