1/* 2 Question: 3 There are multiple paths from one point to another, and the minimum value of the maximum noise value of these channels is obtained! And 4 5 ideas: There are a maximum of 100 points, and then there are multiple queries, don't think about it, Floyd algorithm starts! 6 */7 # include <iostream> 8 # include <cstring> 9 # include <cstdio> 10 # define INF 0x3f3f3f3f11 using namespace STD; 12 13 int map [105] [105]; 14 15 int main () {16 int n, m, Q; 17 int U, V, D; 18 int CNT = 0; 19 scanf ("% d", & N, & M, & Q); 20 while (n | M | q )) {21 memset (MAP, 0x3f, sizeof (MAP); 22 while (M --) {23 scanf ("% d", & U, & V, & D); 24 map [u] [v] = map [v] [u] = D; 25} 26 for (int K = 1; k <= N; ++ K) 27 for (INT I = 1; I <= N; ++ I) 28 for (Int J = 1; j <= N; ++ J) {29 int dd = max (Map [k] [J], map [I] [k]); 30 if (Map [I] [J]> dd) 31 map [I] [J] = dd; 32} 33 printf ("case # % d \ n", ++ CNT); 34 while (Q --) {35 scanf ("% d", & U, & V); 36 IF (Map [u] [v] = inf) 37 printf ("no path \ n"); 38 else39 printf ("% d \ n", map [u] [v]); 40} 41 scanf ("% d", & N, & M, & Q); 42 if (n | M | q )) 43 printf ("\ n"); 44} 45 return 0; 46}