#include #include #include #include #include using namespace std; int get_dist(string a, string b); void make_graph(vector wlist, int map[][200]); int bfs(int map[][200], int start, int dest, int s); int main(){ int tc; cin>>tc; while(tc--){ string w=""; vector wlist; int map[200][200]; while(w!="*"){ cin>>w; wlist.push_back(w); } make_graph(wlist, map); cin.ignore(); string line, s1, s2; getline(cin, line); while(line!=""){ int l1, l2; istringstream iss(line); iss>>s1>>s2; for(int i=0; i q; int pred[200], n; bool visited[200] = {false}; q.push(start); while(!q.empty()){ n = q.front(); q.pop(); for(int i=0; i wlist, int map[][200]){ for(int i=0; i