#include <iostream> #include <cstring> #include <queue> using namespace std; const int N = 10010, M = 2e5 + 10; int n, m, s, t; int h1[N], e1[M], ne1[M], idx1; int h2[N], e2[M], ne2[M], idx2; bool st[N]; int d[N]; void add(int a, int b) { e1[idx1] = b, ne1[idx1] = h1[a], h1...