기출 문제 / 삼성 2021 First Half Afternoon Problem 2

Maze Tower Defense

In an n×n spiral maze, monsters of types 1, 2, and 3 are invading.

The player aims to eliminate the monsters from the tower located at the center of the grid. Monsters are removed according to the following methods: