Cod sursa(job #2199670)

Utilizator FunnyStockyMihnea Andreescu FunnyStocky Data 28 aprilie 2018 17:43:28
Problema Lacate Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.36 kb
#include <fstream>
using namespace std;
ifstream a("lacate.in");
ofstream b("lacate.out");
int n,y,x,cnt,i,j;
int main(){
    a>>n;
    b<<n*(n-1)/2<<" "<<n-1<<"\n";
    x=n*(n-1)/2;
    for(j=1;j<=2;j++)
        for(i=1;i<=x;i++){
            b<<i<<" ";
            cnt++;
            if(cnt%(n-1)==0)
                b<<"\n";
        }
    return 0;
}