Cod sursa(job #2070907)

Utilizator stefan_creastaStefan Creasta stefan_creasta Data 20 noiembrie 2017 00:06:30
Problema Tije Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.39 kb
#include <cstdio>
using namespace std;

int main() {
  int n;
  freopen("tije.in", "r", stdin);
  freopen("tije.out", "w", stdout);
  scanf("%d", &n);
  for(int i = n - 1; i >= 1; --i) {
    for(int j = n; j >= 1; --j) {
      for(int k = 1; k <= i; ++k) {
        printf("%d %d\n", j, j + 1);
      }
    }
    for(int j = 1; j <= i; ++j) {
      printf("%d 1\n", n + 1);
    }
  }
  return 0;
}