Cod sursa(job #48503)
| Utilizator | Data | 4 aprilie 2007 20:49:18 | |
|---|---|---|---|
| Problema | Plantatie | Scor | 0 |
| Compilator | fpc | Status | done |
| Runda | Arhiva de probleme | Marime | 0.52 kb |
type matrice=array[1..500,1..500] of 0..1000000000;
var a:matrice;
f,g:text;
i,j,i1,j1,n,k:1..500;
w,m:1..75000;
max:0..1000000000;
begin
assign(f,'plantatie.in'); assign(g,'plantatie.out');
reset(f); rewrite(g);
readln(f,n,m);
for i:=1 to n do
begin
for j:=1 to n do
read(f,a[i,j]);
readln(f);
end;
max:=0;
for w:=1 to m do
begin
readln(f,i1,j1,k);
for i:=i1 to i1+k do
for j:=j1 to j1+k do
if a[i,j]>max then max:=a[i,j];
writeln(g,max);
max:=0;
end;
end.