1. 백준 1012 import sys from collections import deque dx = [-1, 1, 0, 0] dy = [0, 0, -1, 1] def bfs(x, y): q = deque([(x, y)]) board[x][y] = 0 while q: cx, cy = q.popleft() for i in range(4): nx = cx + dx[i] ny = cy + dy[i] if nx = 0 and ny = 0: if board[nx][ny] == 1: board[nx][ny] = 0 q.append((nx, ny)) T = int(input()) for _ in range(T): M, N, K = map(int, sys.stdin.readl..