Problem A
All Pairs Shortest Path
Input
The input consists of several test cases. Each test case
starts with a line with three non-negative integers,
Input will be terminated by a line containing 0 0 0, this line should not be processed.
Output
For each query, output a single line containing the minimum
distance from node
Sample Input 1 | Sample Output 1 |
---|---|
4 3 4 0 1 2 1 2 2 3 3 1 0 2 1 2 3 0 3 3 2 1 2 0 1 100 0 1 1 0 0 0 0 |
4 2 Impossible 0 100 Impossible |