Imagine an infinite ocean, with a single tiny island in the middle. Call this island position (0, 0). Now say there is a ship somewhere in this ocean, and it starts at an exact integer number of miles away from the island in both the x and y directions. You can picture an infinite grid centered on the island, and the ship starts on one of the grid points. The ship then starts moving; it has an x-velocity and y-velocity that are both integer numbers of miles per hour.

You are in command of a missile launch facility that can fire one missile every hour. The missiles are perfectly accurate and hit any location instantly.

What is a strategy for launching missiles such that, no matter the ship’s starting position and velocity, you will hit it within a finite amount of time?

Could you generalize your solution, so that you could hit a spaceship with an integer starting z-coordinate and integer z-velocity?