Galactic Expedition

시간 제한8초메모리 제한1024 MB

문제

The inhabitants of Flatland have finally managed to invent spacecraft, and send a hexagon to embark on a brave journey to explore their two-dimensional outer space. Their goal is to reach an ancient relic that might teach them about the absurd idea of a "third dimension". You are head of operations at the home base, coordinating the movements of the spaceship.

The spaceship has enough fuel to travel a certain distance in space, but it can be refuelled at the home base if necessary. Chances are high that the spaceship does not have enough fuel to travel to the relic directly, but you quickly discover that outer space is scattered with wormholes that allow the spaceship to teleport from one location to another. Your team manages to draw out a map with all the warp-points they can observe, but it is impossible to figure out which pairs of warp-points are connected to each other, except by flying through them. Time to start exploring!