#include<bits/stdc++.h> using namespace std; typedef long long ll; const int N=200000+10,M=1e4+5,mod=1e9+7; ll n,m,s,t,h[N],cur[N],cnt=1,vis[N]; struct node{ ll to,nt,w; }e[N]; void add(ll u,ll v,ll w) { e[++cnt]={v,h[u],w}; h[u]=cnt; } queue<ll>q; bool bfs() { memset(vis,0,sizeof(vis));...