Pagini recente » Cod sursa (job #2759953) | Monitorul de evaluare | Cod sursa (job #1544145) | Cod sursa (job #2954448) | Cod sursa (job #215518)
Cod sursa(job #215518)
program tije;
var n,i,j,k:longint;
begin
assign(input,'tije.in'); reset(input);
assign(output,'tije.out'); rewrite(output);
readln(n);
for i:= n downto 2 do
begin
for j:= n-1 downto 1 do
writeln(i,' ',n+1);
for j:= n-i+1 downto 1 do
writeln(i-1,' ',i);
for j:= i-2 downto 1 do
begin
for k:= n-i downto 1 do
writeln(j,' ',j+1);
writeln(n+1,' ',j+1);
writeln(j,' ',i);
end;
for j:= n-i+1 downto 1 do
writeln(n+1,' ',1);
end;
close(input);
close(output);
end.