Cod sursa(job #1840447)

Utilizator stelian2000Stelian Chichirim stelian2000 Data 4 ianuarie 2017 14:11:46
Problema Lacate Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.52 kb
#include <cstdio>

using namespace std;

int d[300][300];

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