#include<stdio.h> using namespace std; const int maxn=220; int a[maxn][maxn],pre[maxn],m,n,ans; inline int work_work(){ int queue[maxn]={0},mark[maxn]={0},head=0,tail=1,i; queue[tail]=mark[1]=1; while(head!=tail) { head++; for(i=1;i<=m;i++) if(i!=queue[head]&&mark[i]==0&&a[queue[head]][i]>0) { queue[++tail]=i;mark[i]=1;pre[i]=queue[head]; if(i==m)return 1; } } return 0; } inline int work_main(){ if(!work_work())return 0; int min=a[pre[m]][m]; for(int i=m;i!=1;i=pre[i])if(a[pre[i]][i]<min)min=a[pre[i]][i]; for(int i=m;i!=1;i=pre[i])a[pre[i]][i]-=min,a[i][pre[i]]+=min; ans+=min; return 1; } void init(){ scanf("%d",&n); scanf("%d",&m); int i,x,y,z; for(i=1;i<=n;i++){ scanf("%d",&x); scanf("%d",&y); scanf("%d",&z); a[i][j]+=k; } } void work(){ while(work_main()); } void print(){ printf("%d/n",ans); } int main(){ init(); work(); print(); return 0; }