시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 512 MB 0 0 0 0.000%

문제

Little girl Masha is looking at the wall in her room. The wall is tiled with square tiles, but some of the tiles are replaced with lamps. So it is possible to consider the wall to be a rectangle of n × m, some cells contain tiles, other cells contain lamps.

Masha has paints of k different colors. Consider continuous vertical or horizontal segments of tiles, having an edge of the wall or a lamp at each of its ends. Masha wants to paint all tiles in such way, that any such segment has all tiles painted in different colors. Masha will not paint lamps. She doesn't have to use all the colors.

Help Masha to paint the wall.

입력

Input contains several test cases. The first line contains the number of test cases t.

Each test case is described by several lines. The first line contains three integers: n, m, k (1 ≤ n, m ≤ 100, 1 ≤ k ≤ max(n, m)) — the size of the wall and the number of paints Masha has.

The following n lines contain m integers aij each:

  • aij = 0 means that the position (i, j) contains the lamp;
  • aij = 1 means that the position (i, j) contains the tile.

The total number of tiles and lamps in all test cases of one input doesn't exceed 105.

출력

For each test case first print the answer:

  • NO, if there is no way to paint the wall.
  • YES, if there is at least one way to paint the wall. In this case the following n lines must contain m integers bij each — the color of the tile at position (i, j), or 0, if there is a lamp at this position. If there are several ways to paint the wall, you can output any one.

예제 입력 1

2
4 3 2
0 1 0
1 0 1
1 0 1
0 1 0
3 4 2
0 1 0 1
1 0 1 1
1 1 1 0

예제 출력 1

YES
0 2 0 
2 0 2 
1 0 1 
0 1 0 
NO