기출 문제 / 삼성 2020 Second Half Afternoon Problem 2

Rotating Glacier

We are tasked with rotating a 2n×2n grid of glaciers. Each ice block within the glacier possesses a property called adjacency rotation. When a specific range of glaciers is selected for rotation from the top-left corner, the adjacent grids in all four directions (up, down, left, right) also rotate by the same amount.