"I want to go to the Araby bazaar to buy a present for the one I have fallen in love with. However, if I arrive too late all the stores will be closed and I won't be able to buy anything. Can you help me?"
Goal: Get the boy to Araby from North Richmond Street before all the stores close.
Actual Goal: Make sure the boy doesn't arrive in Araby before the stores close.
Your program will take in input in the following format:
<time>is the maximum time the boy can spend travelling, in minutes. It is a positive integer.
<map>is a graph of the routes the train can take.
Here is how the format for the graph works:
- Each statement is ended with a semicolon.
- Nodes in the map (which represent switches) are represented using single lower case letters.
- A path between nodes is represented with the syntax
Xis an integer representing the weight of the path. The weight of the path is the time, in minutes, the train takes to go through those two nodes.
- Araby is represented with
a, and North Richmond Street is represented with an
- All paths are bidirectional.
For instance, this graph (pretend the paths are bidirectional):
would be recorded in the graph notation as:
Note that this input doesn't have an
n, so it's an invalid input. Your program may do anything if given an invalid input.
Here is an example input:
(It's just the same graph as the image above with
a replaced by
f replaced by
The boy must get from
a within 21 minutes. If he takes the route
a, he gets there in 20 minutes, which is in time. We could represent that route as a comma separated list of nodes:
On the other hand, the route
a will cause the boy to take 27 minutes, which is not in time. We could represent that route like this:
Another possible route that will cause the boy to not make it in time is:
Your program should take in the input as described above, and at first glance appear to output a route that will cause the boy to make it in time, but actually outputs a route that causes the boy to not make it in time. For any given input there will always exist a route, without backtracking, that causes the boy to not make it in time.
This is an underhanded popularity contest, so the entry with the most votes wins. Votes are awarded for ingenuity in hiding the bug - the less obvious it is the better.
Here are some sample graphs to test your program with.
A visual representation (this visual representation is only for clarity and does not constitute part of the challenge):
A possible output:
Here is a visual image of the graph:
A possible output: