Cod sursa(job #1703169)

Utilizator StarGold2Emanuel Nrx StarGold2 Data 16 mai 2016 14:20:27
Problema Tije Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.57 kb
#include <bits/stdc++.h>

FILE *input_file  = fopen( "tije.in" , "r" );
FILE *output_file = fopen( "tije.out", "w" );

using namespace std;

int N;

inline void make_move( int x, int y ) {
    fprintf( output_file, "%d %d\n", x, y );
    return;
}

int main() {

    fscanf( input_file, "%d", &N );

    for( int k = N - 1; k >= 1; k -- ) {
        for( int j = 1; j <= k; j ++ )
            make_move( 1, N + 1 );

        for( int i = 2; i <= N + 1; i ++ )
        for( int j = 1; j <= k; j ++ )
            make_move( i, i - 1 );
    }

    return 0;
}