2 n
,m
,x
,i
,j
,k
,h
,l
,r
,ans
,a
,b
,p
,q
:longint;
3 hash
:array [1..3000,1..3000] of longint;
7 assign(input
,'base.in'); reset(input
);
8 assign(output
,'base.out'); rewrite(output
);
20 while (k
>0) and (hash
[k
,j
]=0) do dec(k
);
22 for l
:=j
-1 downto 1 do
24 for q
:=i
downto k
+1 do
25 if hash
[q
,l
]=1 then begin f
:=false; break
; end;
29 if l
=0 then l
:=1; f
:=true;
32 for q
:=i
downto k
+1 do
33 if hash
[q
,r
]=1 then begin f
:=false; break
; end;
38 if (r
-l
+1)*h
>ans
then ans
:=(r
-l
+1)*h
;
41 close(input
); close(output
);