Cod sursa(job #1142275)

Utilizator PatrikStepan Patrik Patrik Data 13 martie 2014 17:51:41
Problema Lacate Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.5 kb
    #include<cstdio>
    using namespace std;
    int N ,L;

    int main()
    {
        freopen("lacate.in" , "r" , stdin );
        freopen("lacate.out" , "w" , stdout );
        scanf("%d" , &N );
        L = N*(N-1)/2;
        printf("%d %d\n" , L , N-1);
        int p = 1;
        for(int i = 1 ; i <= N ; ++i )
        {
            for(int j = 1 ; j < N ; ++j )
                printf("%d " , p++);
            if(p > L)p = 1;
            printf("\n");
        }
        return 0;
    }