Cod sursa(job #2790021)

Utilizator ioachimoshStanciu Ioachim ioachimosh Data 28 octombrie 2021 12:49:10
Problema Lacate Scor 0
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.49 kb
#include <iostream>
#include <fstream>


using namespace std;

ifstream fin("lacate.in");
ofstream fout("lacate.out");


int main() {
  int mat[260][260];
  int urm = 1;
  int N;
  fin >> N;
  for(int i = 1; i <= N - 1; i++){
    for(int j = i; j <= N - 1; j++){
      mat[i][j] = mat[j + 1][i] = urm;
      urm++;
    }
  }
  fout << N - 1 << " " << N * (N - 1) / 2 << "\n";
  for(int i = 1; i <= N; i++){
    for(int j = 1; j <= N - 1; j++){
      fout << mat[i][j] << " ";
    }
    fout << "\n";
  }
}