Pagini recente » Cod sursa (job #3150244) | Monitorul de evaluare | Diferente pentru home intre reviziile 342 si 343 | Cod sursa (job #141574) | Cod sursa (job #972649)
Cod sursa(job #972649)
var a:array[1..257,1..256]of longint;
n,x,i,j:longint;
buf:array[1..1 shl 15]of char;
procedure z(n,st,c:longint);
var i,z:longint;
begin
z:=c;
for i:=st to st+n do begin a[c,z]:=i; inc(z); end;
z:=c+1;
for i:=st to st+n do begin a[z,c]:=i; inc(z); end;
x:=st+n;
end;
begin
assign(input,'lacate.in'); reset(input);
readln(n);
x:=1;
for i:=n-1 downto 1 do z(i,x,n-i);
assign(output,'lacate.out'); rewrite(output); settextbuf(output,buf);
writeln(x-1,' ',n-1);
for i:=1 to n do begin
for j:=1 to n-1 do write(a[i,j],' '); writeln; end;
close(output);
end.