int flow[205][205];
int cap[205][205];
int m,n;//m表示边数,n表示点数,均从1开始
int ford_furkerson()
{
int ret=0;
bool fl[205];
int pre[205];
int ft[205];
while(1)
{
memset(fl,0,sizeof(fl));
memset(pre,-1,sizeof(pre));
memset(ft,0x1f,sizeof(ft));
queue<int>q;
q.push(1);
fl[1]=1;
while(!q.empty())
{
int v=q.front();
q.pop();
for(int i=1;i<=n;i++)
{
if(!fl[i]&&cap[v][i]>flow[v][i])
{
fl[i]=1;
pre[i]=v;
q.push(i);
ft[i]=(ft[v]<cap[v][i]-flow[v][i]?ft[v]:cap[v][i]-flow[v][i]);
}
}
}
if(ft[n]==0x1f1f1f1f)break;
ret+=ft[n];
for(int i=n;pre[i]!=-1;i=pre[i])
{
flow[pre[i]][i]+=ft[n];
flow[i][pre[i]]-=ft[n];
}
}
return ret;
}