Question #1 -- The Land of Oz
Dorothy and friends are travelling through the Land of Oz
in order to see The Wizard. Their
starting point and end point are fixed, but they have considerable
choices as to which territories to travel through en route.
Input
The possible routes are shown in the figure below, and constitute the
input to the problem.
Each territory is represented by a numbered block. The labels on the arrows
connecting the territories represent the degree of risk associated
with encountering the Wicked Witch of the West; the higher the risk, the
higher the number.
Output
- Line 1: The cost of a path with the minimum total risk.
- Lines 2...:
Denote each path of minimum total risk, one per line, as a sequence of
numbers, beginning with the starting territory and
ending with The Wizard.