Program Kofe; uses xcrt; Var fol: array [1..13,1..13] of integer; maxf: integer; pm: array [1..13] of integer; a: array [1..13,1..13] of integer; k: integer; i,j: integer; f: text; sp: array [1..13] of integer; v,w:integer; otec: array [1..13] of integer; {si,sj: array [1..13] of integer;} Procedure PMCH; Var och: array [1..100] of integer; t,t1: integer; begin for i:=1 to k do pm[i]:=32000; t:=1; t1:=1; och[t]:=1; otec[1]:=32000; while (pm[k]=32000) and (t-t1>=0) do begin w:=och[t1]; t1:=t1+1; for v:=1 to k do if (pm[v]=32000) and (a[w][v]-fol[w][v]>0) then begin if pm[w]0) then begin if pm[w]1 do begin w:=otec[v]; if sp[v]=1 then fol[w,v]:=fol[w,v]+pm[k] else fol[v,w]:=fol[v,w]-pm[k]; v:=w; end; end; {печать промежуточных потоков} { for i:=1 to k do begin write(i:3); for j:=1 to k do begin write(fol[i,j]:4); end; writeln; end; write(maxf); readln;} until pm[k] =32000; {остатки} { for i:=1 to k do begin write(i:3); for j:=1 to k do begin write(a[i,j]-fol[i,j]:4); end; writeln; end; write('конец'); readln;} {проверка} { for i:=1 to k do begin si[i]:=0; sj[i]:=0; end; for i:=1 to k do for j:=1 to k do begin si[i]:=si[i]+a[i,j]; sj[j]:=si[j]+a[i,j]; end; for i:=1 to k do if si[i]-sj[i]<>0 then begin write('неправильно'); readln; end;} {печать потока} write(' '); for i:=1 to k do write(i:4); writeln; writeln; for i:=1 to k do begin write(i:3); for j:=1 to k do begin write(fol[i,j]:4); end; writeln; end; write(maxf); readln; End.