04-Crazy Euclid
CodeChefOpen on judge ↗
There's a chip in the point (0,0) of the coordinate plane. In one operation, you can move the chip from some point (x1,y1) to some point (x2,y2) if the Euclidean distance between these two points is an integer (i.e. $\sqrt{(x1−x2)^2+(y1−y2)^2}$ is integer). Your task is to determine the minimum number of operations required to move the chip from the point (0,0) to the point (x,y). ### Input The
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