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

Destroying Turrets

There is an N×M grid, and every position contains a turret. Each turret has an attack power, which can decrease or increase depending on the situation. Additionally, if the attack power becomes 0 or less, the turret is destroyed and can no longer attack.