Home Page | Web Board | Problems | Standing | Status | Award Contest |
Problem G:Jill's Tour Paths Time Limit:1000MS Memory Limit:65536K Description
Every year, Jill takes a bicycle tour between two villages. There are different routes she can take between these villages, but she does have an upper limit on the distance that she wants to travel. Given a map of the region indicating the cities and the roads between them (and their distances), Jill would like to have a list of the various routes between the selected cities that will meet her distance requirements. Your task is to write a program that will produce a list of these routes, in increasing order of distance.
Input
The input will contain several possible cases, each including a route map, identification of the start and destination villages, and the maximum distance Jill is willing to travel.
Output
For each case, display the case number (1, 2, ...) on the first line of output. Then, each on a separate additional line, list the routes that Jill might take preceded by the length of the route. Order the routes first by length, from shortest to longest. Within routes having the same length, order them in increasing lexicographic order. The sample input and output provide suitable examples, and the formatting shown there should be followed closely (each village number should be separated by a single space).
Sample Input
Sample Output
|
[Submit] [Go Back] [Status] [Clarify]
All Copyright Reserved 2003
Any problem, Please Contact Administrator