#include #include #include using namespace std; int main() { int a,b,x,y,k=0; cin>>b>>a; vectorpar[a+1]; bool v[a+1]; for(int i=0;i>x>>y; par[x].push_back(y); par[y].push_back(x); } for(int i=0;i>s>>ttl; queueQ; Q.push(s); Q.push(ttl); v[s]=true; while(!Q.empty()) { int teme=Q.front(); Q.pop(); int pat=Q.front(); Q.pop(); for(int i=0;i0) { Q.push(sosed); Q.push(pat-1); v[sosed]=true; } } } for(int i=0;i