Pagini recente » Cod sursa (job #242500) | Cod sursa (job #1055583) | Cod sursa (job #531978) | Cod sursa (job #1063466) | Cod sursa (job #365932)
Cod sursa(job #365932)
#include<iostream>
#include<string>
using namespace std;
#define FOR(i,a,b)for(i=(a);i<=(b);++i)
#define FORN(i,a,b)for(i=(a);i>=(b);--i)
int N;
int main()
{
int layer,pile,hm;
freopen("tije.in","r",stdin);
freopen("tije.out","w",stdout);
scanf("%d",&N);
FOR(layer,1,N)
{
int to_move=N-layer;
FORN(pile,N,1)
FOR(hm,1,to_move)
printf("%d %d\n",pile,pile+1);
FOR(hm,1,to_move)
printf("%d %d\n",N+1,1);
}
return 0;
}