Cod sursa(job #993829)

Utilizator AlexandruValeanuAlexandru Valeanu AlexandruValeanu Data 4 septembrie 2013 15:52:38
Problema Tije Scor 90
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.52 kb
#include <iostream>
#include <fstream>

using namespace std;

int N;

int main()
{
    ifstream f("tije.in");
    ofstream g("tije.out");

    f >> N;

    for ( int cate = N - 1; cate >= 1; cate-- )
    {
        for ( int j = 1; j <= cate; ++j )
                g << 1 << " " << N + 1 << "\n";

        for ( int i = 2; i <= N + 1; ++i )
                for ( int j = 1; j <= cate; ++j )
                        g << i << " " << i - 1 << "\n";
    }

    f.close();
    g.close();

    return 0;
}