기출 문제 / 삼성 2019 First Half Morning Problem 1

Temporal Storm

The room is filled with dust, arranged in an n×m grid. The dust is accumulated in each cell, and you want to clean it using a machine called the Temporal Storm, which automatically removes dust from the room.

The Temporal Storm is always installed in the first column and occupies two cells.