Cod sursa(job #2822170)

Utilizator RaresFelixTudose Rares Felix RaresFelix Data 23 decembrie 2021 17:51:42
Problema Lacate Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.46 kb
#include <bits/stdc++.h>

using namespace std;
vector<int> C[271];
int n, l;
int main() {
    freopen("lacate.in", "r", stdin);
    freopen("lacate.out", "w", stdout);
    scanf("%d", &n);
    for(int i = 1; i <= n; ++i)
        for(int j = i + 1; j <= n; ++j) C[i].push_back(++l), C[j].push_back(l);
    printf("%d %d\n", l, n - 1);
    for(int i = 1; i <= n; ++i) {
        for(int j = 0; j < n - 1; ++j) printf("%d ", C[i][j]);
        printf("\n");
    }
    return 0;
}