#7569 토마토 (https://www.acmicpc.net/problem/7569) 오랜만에 풀어낸 BFS문제였다. from sys import stdinfrom collections import dequeinput = stdin.readline# 쌓아올려지는 상자의 수를 나타내는 H# M은 상자의 가로 칸의 수# N은 상자의 세로 칸의 수를 나타낸다# 단, 2 ≤ M ≤ 100, 2 ≤ N ≤ 100, 1 ≤ H ≤ 100 이다m, n, h = map(int, input().split())tomato = [] # 토마토 상자 데이터red = deque() # 익은 토마토 데이터# 방문 기록visited = [[[-1 for _ in range(m)] for __ in range(n)] for _..