Pagini recente » Cod sursa (job #2989372) | Cod sursa (job #1637814) | Cod sursa (job #2474975) | Cod sursa (job #2509199) | Cod sursa (job #463923)
Cod sursa(job #463923)
var v:array[1..300,1..300]of integer;
i,j,n,l,c:integer;
begin
assign(input,'lacate.in');reset(input);
assign(output,'lacate.out');rewrite(output);
read(n);
l:=n*(n-1) div 2;
writeln(l,' ',n-1);
c:=1;
for i:=1 to n do
for j:=1 to n-1 do begin
v[i,j]:=c;
inc(c);
if c>l then c:=1;
end;
for i:=1 to n do begin
for j:=1 to n-1 do write(v[i,j],' ');
writeln;
end;
close(output);
end.