← All problemsSign in

Collect the blocks

There exist a 2-Dimensional rectangular field of infinite length and breadth. N Iron Blocks are dropped onto this field from the sky at particular coordinates. However, it is made sure that only one block is dropped at a particular coordinate. You are standing at a particular location (X, Y) of the field. You have a magnet with a power M in your hand. A magnet of power M at coordinates (x1, y1)

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start