Cod sursa(job #1087291)

Utilizator axelteoTeodor Dutu axelteo Data 19 ianuarie 2014 10:50:38
Problema Lacate Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.44 kb
#include <cstdio>
using namespace std;
int main()
{
    freopen("lacate.in","r",stdin);
    freopen("lacate.out","w",stdout);
    unsigned short int keye=1,j,i,n;
    scanf("%hu",&n);
    printf("%hu %hu\n",n*(n-1)/2,n-1);
    for(i=1;i<=n;i++)
    {
        for(j=1;j<=n-1;j++)
        {
            printf("%hu ",keye);
            ++keye;
            if(keye>n)keye=1;
        }
        printf("\n");
    }
    return 0;
}