Pagini recente » Cod sursa (job #454968) | Cod sursa (job #2304989) | Cod sursa (job #1084846) | Cod sursa (job #179624) | Cod sursa (job #234037)
Cod sursa(job #234037)
var
a:array[1..260,1..260] of integer;
n,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:=1 to n-1 do
for j:=i to n-1 do
begin
a[i,j]:=ind;
inc(ind);
end;
ind:=1;
for j:=1 to n-1 do
for i:=j+1 to n do
begin
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.