var m,n,max:longint;
a,b:array[1..10,1..10] of char;
procedure nhap;
var i,j:longint;
begin
readln(m,n);
for i:=1 to m do
begin
for j:=1 to n do
read(a[i,j]);
readln;
end;
for i:=1 to m do
begin
for j:=1 to n do
read(b[i,j]);
readln;
end;
end;
function ss(x,y,z,d,e,f:longint):boolean;
var i,j:longint;
begin
for i:=1 to e do
for j:=1 to f do
if a[x+i-1,y+j-1]<>b[z+i-1,d+j-1] then exit(false);
exit(true);
end;
procedure giai;
var i,j,xa,ya,xb,yb:longint;
begin
max:=0;
for i:=1 to m do
for j:=1 to n do
for xa:=1 to m+1-i do
for ya:=1 to n+1-j do
for xb:=1 to m+1-i do
for yb:=1 to n+1-j do
if ss(xa,ya,xb,yb,i,j)=true then
if (i*j)>max then max:=i*j;
write(max);
end;
begin
assign(input,'bangcon.inp');reset(input);
assign(output,'bangcon.out');rewrite(output);
nhap;
giai;
end.
* Chuyên dạy lập trình ONLINE cho học sinh THCS, THPT *.
Mọi giao lưu, trao đổi, xin liên hệ: Lê Quang Vinh - zalo: 037.803.8755.
Page: Lớp học Code Sky
Group FB1: Ôn thi HSG9 - THTB - TS10 chuyên tin
Group FB2: Học Scratch - Ôn thi Tin học trẻ bảng A
Thứ Năm, 28 tháng 4, 2022
BANGCON PASCAL
Đăng ký:
Đăng Nhận xét (Atom)
Không có nhận xét nào:
Đăng nhận xét
Lưu ý: Chỉ thành viên của blog này mới được đăng nhận xét.