Escape from the Unknown Space
You are a time traveler. During your journey, due to a malfunction of your time machine, you find yourself trapped in an unknown space of size N×N. To escape, you must use your time machine to gather geographical information about this space.
This space is a 2D plane with a side length of N, and somewhere within it, there is a Wall of Time in the shape of a cube with a side length of M.