#include<iostream>#include<cstring>#include<queue>using namespace std;typedef pair<int,int> PII;const int N=105;int n,m,g[N][N