Cod sursa(job #2575714)

Utilizator valentinchipuc123Valentin Chipuc valentinchipuc123 Data 6 martie 2020 15:07:53
Problema Tije Scor 90
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.41 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;
}