Cod sursa(job #326592)

Utilizator GheorgheMihaiMihai Gheorghe GheorgheMihai Data 25 iunie 2009 16:50:55
Problema Tije Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.36 kb
#include<stdio.h>
int n;

void read()
{
	freopen("tije.in","r",stdin);
	freopen("tije.out","w",stdout);
	scanf("%d",&n);
}

void rez()
{
	int i,j,k;
	for(i=n-1;i>=1;i--)
	{
		for(j=n;j>=1;j--)
			for(k=1;k<=i;k++)
				printf("%d %d\n",j,j+1);
		for(j=1;j<=i;j++)
			printf("%d 1\n",n+1);
	}
}

int main()
{
	read();
	rez();	
	return 0;
}