Controls

1
Position at step 1: (0, 0)

Problem

A honey cake is hidden in a magical forest represented as an infinite 2D grid. Bearcu starts at position (0,0) and uses BFS to search for it.

The algorithm checks neighbors in order: left, up, right, down.

Given step K, find the position (x, y) being checked at that step.

Grid Visualization

1
x
y