#include<bits/stdc++.h> using namespace std; #define inf 99999999 #define N 102 int e[N][N], dis[N], visit[N]; int main(){ int test; cin >> test; int m, n, d; while(test--){ cin >> m >> n >> d; fill(e[0], e[0] + N*N, inf); for(int i = 0; i <...