Cod sursa(job #1703379)

Utilizator iordache.bogdanIordache Ioan-Bogdan iordache.bogdan Data 16 mai 2016 21:01:48
Problema Tije Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.48 kb
#include <cstdio>
#include <vector>
#include <cstring>
#include <algorithm>

using namespace std;

int main() {

	freopen("tije.in", "r", stdin);
	freopen("tije.out", "w", stdout);


	int n;
	scanf("%d", &n);

	for (int step = n - 1; step; --step) {

		for (int i = 1; i <= step; ++i)
			printf("1 %d\n", n + 1);

		for (int i = 2; i <= n + 1; ++i)
			for (int j = 1; j <= step; ++j)
				printf("%d %d\n", i, i - 1);

	}

	return 0;

}

//Trust me, I'm the Doctor!