Pagini recente » Cod sursa (job #2778818) | Cod sursa (job #108223) | Cod sursa (job #2015101) | Cod sursa (job #36681) | Cod sursa (job #18383)
Cod sursa(job #18383)
var max,i,j,n,m,lin,col,lung:longint;
mat:array [1..500,1..500] of longint;
begin
assign (input,'plantatie.in'); reset (input);
assign (output,'plantatie.out'); rewrite (output);
readln (n,m);
for i:=1 to n do begin
for j:=1 to n do read (mat[i,j]);
readln;
end;
while m>0 do begin max:=0;
readln (lin,col,lung);
for i:=lin to lin+lung-1 do
for j:=col to col+lung-1 do
if mat[i,j]>max then max:=mat[i,j];
writeln (max); dec (m);
end;
close (input); close (output);
end.