Pagini recente » Cod sursa (job #1015478) | Cod sursa (job #1531819) | Cod sursa (job #3185279) | Cod sursa (job #3229451) | Cod sursa (job #107121)
Cod sursa(job #107121)
var v: array[1..500, 1..500] of word;
n, i, j, k, x, y, z, max: word;
m: longint;
f, g: text;
begin
assign(f, 'plantatie.in');
reset(f);
readln(f, n, m);
for i:=1 to n do begin
for j:=1 to n do
read(f, v[i, j]);
readln(f);
end;
assign(g, 'plantatie.out');
rewrite(g);
for i:=1 to m do begin
readln(f, x, y, z);
max:=0;
for j:=x to x+z-1 do
for k:=y to y+z-1 do
if v[j, k]>max then
max:=v[j, k];
writeln(g, max);
end;
close(f);
close(g);
end.