#include #define pt(sth) cout << sth << "\n" #define itr(x,c) for(auto x=c.begin();x!=c.end();x++) #define all(a) (a.begin()),(a.end()) using namespace std; #include using namespace atcoder; typedef long long ll; typedef pair pll; templatebool chmax(T &a, const T &b) {if(abool chmin(T &a, const T &b) {if(b>a[i]; typedef vector v1D; typedef vector v2D; typedef vector v3D; int main(void) { ll i,j,k; ll N,M,S,T;cin>>N>>M>>S>>T;S--;T--; dsu d(N); vector a(N); for(i=0;i>a[i]; for(i=0;i>x>>y;x--;y--; d.merge(x, y); } set st; for(i=0;i