const MaxM=100; MaxN=100; var Mesto,MatA,MatB:array[0..MaxM+1,0..MaxN+1] of integer; M,N:integer; i,j,b:integer; MinNad,MinPod:integer; Vel:integer; MaxVel:integer; Mi,Mj,Mk,Ml:integer; begin {Sem patri vstup dat a prevod na jednicky a nuly, ale uz se nevesel na stranku} {naplneni okraju nulami v matici Mesto } for i:=0 to M+1 do begin Mesto[0,i]:=0; Mesto[N+1,i]:=0; end; for i:=0 to N+1 do begin Mesto[i,0]:=0; Mesto[i,M+1]:=0; end; {vytvoreni matic MatA a MatB} for j:=1 to M do begin for i:=N+1 downto 1 do if Mesto[i,j]=0 then MatA[i,j]:=0 else MatA[i,j]:=MatA[i+1,j]+1; {jednicka nad jednickami} for i:=1 to N do if Mesto[i,j]=0 then MatB[i,j]:=0 else MatB[i,j]:=MatB[i-1,j]+1; {jednicka pod jednickami} end; {vyhledani nejvetsiho nuloveho obdelnika} MaxVel:=0; for i:=1 to N do for j:=0 to M-1 do if Mesto[i,j]=0 then begin { Projdi jednicky vpravo od Mesto[i,j] } b:=1; MinPod:=maxint; MinNad:=maxint; while Mesto[i,j+b]=1 do begin if MatA[i,j+b]