Pagini recente » Cod sursa (job #1355171) | Cod sursa (job #1336926) | Cod sursa (job #2975207) | Cod sursa (job #2450738) | Cod sursa (job #233996)
Cod sursa(job #233996)
var n:byte;
a:array[1..25,1..25] of integer;
i,j,ind:integer;
f:text;
begin
assign(f,'lacate.in');reset(f);
read(f,n);
close(f);
assign(f,'lacate.out');rewrite(f);
writeln(f,n*(n-1) div 2,' ',n-1);
a[1,1]:=1; ind:=1;
for i:=2 to n do
begin
if ind=((n-1)*n div 2)+1 then ind:=1;
a[i,1]:=ind;
inc(ind);
end;
for j:=2 to n-1 do
for i:=1 to n do
begin
if ind=((n-1)*n div 2)+1 then ind:=1;
a[i,j]:=ind;
inc(ind);
end;
for i:=1 to n do
begin
for j:=1 to n-1 do
write(f,a[i,j],' ');
writeln(f);
end;
close(f);
end.