2
2 2 0
5
第一个样例解释:
Consider the first example. In the given grid, cells (0,0),(0,1),(1,0),(1,1) are white, and all other cells are black. Let us use triples to describe the grid: triple (x,y,z)means that there are z dolls placed on cell (x,y). Initially the state of the grid is (0,0,1).
One of the optimal sequence of operations is as follows:
Now all white cells contain 0 dolls, so we have achieved the goal with 5 operations.