G.W. Coding Contest 2 P6: Hall Traffic
Samuel is getting tired of the hall traffic at Dr. G.W. Williams S.S when moving classes, so he decides to measure the average number of people in each hall after every period, on both floors. Each hall is labelled with a number increasing from 1, and some halls are connected to the other floors by stairs which go directly upwards (Stairs are considered as 0 average people). Starting from his class at hall \(A\), what is the least crowded pathing Samuel can use get to his class in hall \(B\)?
The hall and stair placements are formatted in the same manner as the diagram shown below, to pass through a hall in any capacity will incur it's cost. Stairs in the corners of halls are connected to both halls, meaning you do not need to incur the cost of the other hall to use the stairs.
The first line will contains two integers, \(A\), the starting hall, and \(B\), the destination hall.
The next 12 lines will contain \(K\), the average number of people in each hall, for each respective hall \(\{1 \leq K \leq 2^{63}\). (i.e. line 2 is for hall 1, line 3 is for hall 2, etc.)
Output the pathway Sam can take to minimize the traffic he must go through, each hallway should be seperated by a new line.
Floor 1:
Floor 2:
Note: The connections to stairs work in a mannner such that if any part of the hall is touching the stair, then that hall is connected to that stair. For example, hall 1, 3 and 9 are all the connections to stair 1.
Sample Input 1:
Sample Output 1:
Sample Input 2:
Sample Output 2:
Submit Solution