Cod sursa(job #3392)
Utilizator | Serban Cosmin kenzo29 | Data | 24 decembrie 2006 12:13:35 |
---|---|---|---|
Problema | Lacate | Scor | 100 |
Compilator | fpc | Status | done |
Runda | Arhiva de probleme | Marime | 0.84 kb |
program lacate;
type
ma=array[1..300,1..300] of longint;
var
f:text;
n,i,j,c:longint;
a:ma;
begin
assign(f,'lacate.in');
reset(f);
readln(f,n);
close(f);
dec(n);
c:=0;
for i:=1 to n do
for j:=i to n do begin
inc(c);
a[i,j]:=c;
end;
c:=0;
for j:=1 to n do
for i:=j+1 to n+1 do begin
inc(c);
a[i,j]:=c;
end;
assign(f,'lacate.out');
rewrite(f);
writeln(f,c,' ',n);
for i:=1 to n+1 do begin
for j:=1 to n do
write(f,a[i,j],' ');
writeln(f);
end;
close(f);
end.