All pairs shortest paths ------------------------ In this problem, you will implement the Floyd-Warshall algorithm for computing all-pairs shortest paths in a weighted directed graph. Input ----- The input will consist of multiple instances. The first line of each instance will contain two integers n and m, representing the number of nodes and edges in the graph, respectively. These values will satisfy 1 <= n <= 300 and 0 <= m <= 800. Following this, there will be m lines, each containing three integers i, j and w, where 1 <= i <= n and 1 <= j <= n, indicating that there is an edge from node i to node j. The weight of this edge is given by w. You can assume that 0 < w < 100. The last line for this instance will be a line containing a single integer x, 1 <= x <= n. The end of the input will be indicated by a line with m=n=0. Output ------ For each input graph, output the cost of the shortest path from node x to each of the other nodes, in the format shown below. If there is no path from node x to some other node, output "no path" for that node. Sample Input ------------ 5 10 1 2 1 1 4 9 2 4 12 2 5 2 4 3 3 4 5 7 3 5 6 4 2 23 5 1 66 3 4 87 1 3 2 1 2 23 2 1 23 3 0 0 Sample Output ------------- Graph #1 1: 0 2: 1 3: 12 4: 9 5: 3 Graph #2 1: no path 2: no path 3: 0