J - Tri-Knight
CodeChefOpen on judge ↗
Have you ever imagined how a chess knight will move on a triangular grid? A triangular grid is a grid where each point has $6$ neighbors, formed in $60^{\circ}$ angles. The coordinates are written with respect to two axes, and in this problem, the two axes have an inner angle of $120^{\circ}$. $(X, Y)$ is the point that is reached by taking $X$ steps of unit length along the horizontal axis, and
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start