In the task it should be stated that the shooter can walk only along Y axis. As nearest shooting point could be in most cases nearer by changing X coordinate.