#include #define endl '\n' using namespace std; typedef long long ll; ll i,j,p,p1,n,m,k,G,E,s,r[1000006],tt,t,iz[1000006],r1[1000006]; bool b[1000006],gfl,izh[1000006]; vector v[1000006],ans,Ans; struct Dv { ll l,r; }t1; queue q; void bfs(ll u) { fill(b+1,b+n+1,0); //b[u]=1; q.push({u,0}); while(!q.empty()) { t1=q.front();q.pop(); if(b[t1.l]==0) { //fout<c) { return (d<=b); } else { return (c<=b); } } void dfs(int u) { //if(gfl==1)return ; //fout<>t; for(tt=1; tt<=t; tt++) { fin>>n>>m>>E>>G>>s;gfl=0; for(i=1; i<=m; i++) { fin>>p>>p1; v[p].push_back(p1); v[p1].push_back(p); } fin>>k; for(i=1; i<=k; i++) { fin>>iz[i]; izh[iz[i]]=1; } bfs(s); bfs2(iz[1]); /**for(i=1;i<=n;i++) fout<