Cod sursa(job #2495777)

Utilizator Vlad3108Tir Vlad Ioan Vlad3108 Data 19 noiembrie 2019 20:13:47
Problema Lacate Scor 100
Compilator cpp-64 Status done
Runda ad_hoc Marime 0.52 kb
#include <bits/stdc++.h>
using namespace std;
vector<int> a[257];
int main(){
    freopen("lacate.in","r",stdin);
    freopen("lacate.out","w",stdout);
    int n;
    scanf("%d",&n);
    printf("%d %d\n",n*(n-1)/2,n-1);
    int ct=0;
    for(int i=1;i<=n;++i)
        for(int j=i+1;j<=n;++j){
            ++ct;
            a[i].push_back(ct);
            a[j].push_back(ct);
        }
    for(int i=1;i<=n;++i){
        for(auto it : a[i])
            printf("%d ",it);
        printf("\n");
    }
    return 0;
}