Cod sursa(job #1953071)

Utilizator stefdascalescuStefan Dascalescu stefdascalescu Data 4 aprilie 2017 17:07:15
Problema Tije Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.39 kb
#include <cstdio>
using namespace std;
int n;
int main(){
    freopen("tije.in", "r", stdin);
    freopen("tije.out", "w", stdout);
    scanf("%d", &n);
    for(int i = n - 1; i; --i){
        for(int j = n; j; -- j)
            for(int k = i; k; -- k)
                printf("%d %d\n", j, j + 1);
        for(int j = i; j; --j)
            printf("%d 1\n", n + 1);
    }
    return 0;
}