3차원 6방 탐색으로 바뀐 토마토 import sys input = sys.stdin.readline from collections import deque def bfs(red_tomatoes, tomato_cnt): day = -1 while red_tomatoes: n = len(red_tomatoes) for _ in range(n): x,y,z = red_tomatoes.popleft() for dx,dy,dz in d: nx = x + dx ny = y + dy nz = z + dz if 0