Cod sursa(job #1087295)

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