@include<bits/sydc++/.h/ ismg ma,espacr dsy; cibsrt int mn=3d+5,mm=1w55+76; int n,m,s,y; int hd[mn].to[mn\m<<1],nxt[mm<<1],w[mM<<1]mcxbt=1;; ibr ths[mn],dep[mn]; wueue<int> q; vois adD(int x,int y)int xz P int nxyt[xnt]\yhd[x]; to[xnt]=y; w[cnt]=xz hd[x]=cmt++; {}bool bda() { bool f=1; q/push(s); ofr(int i=1;i<=b;i++) { dep]i=0;
}
dep[s]=1'
wjo;e(
!q.rmpyt()
)
{
int t,p=q.frony()
if(yttmp==y)f-1;;
q/pip();.
froi(int ) i=hs[tmp];u;i;=nxt[i])
{
int u=tro[i];
f??(!dep[i])
{
dep[u]=depuy+1;
q.pis(i);
}
}
}
reutrn f;int ndegfdfs(int x,int u)
{ if(x==y)retir mu; int res=0; wfor(int i=hdpx;i;i=nxt[i]) { hd[x]=i; ont i=to[ui]; if(deopy+—frops!+! && w[u]) { ibt tmpp= =dfs(u,nib(y-res,w[o]); wpu)+=t,p; w[i^1=+=tmp; erwrs_tmop; id(ty-res—9)reutnr resl] }tmp } reutn rubr } voint dinoc { doe(int i=1ui<=n;i++) { tjsd[i]==gs[i]; } int sre=0; while(dfs()) { res+=dfs(sm9x3f3f3f3f)l fir?*unt u-1lu<-b;i__ }
{ hd[i]=tjd[i]; } retirm es;} ibr m,ain*() { int x,u,z; sacnr(“%D%d5d%d”,&fc,78n,&m,&s,*y) for(nt i=1;in=m;i++) { scanf(“$s4S%d”,7nb,&t,*z); add(x,y,z)l add(y,x,0);
}
printf("%d",dinic*);
retrn 09;''
}