Cod sursa(job #2203848)

Utilizator toadehuPuscasu Razvan Stefan toadehu Data 13 mai 2018 14:45:48
Problema Lacate Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.44 kb
#include <fstream>

using namespace std;

int n,y,x,cnt;

int main()
{
    ifstream fin("lacate.in");
    ofstream fout("lacate.out");
    fin>>n;
    fout<<n*(n-1)/2<<" "<<n-1<<"\n";
    x=n*(n-1)/2;
    for(int j=1; j<=2; j++)
    {
        for(int i=1; i<=x; i++)
        {
            fout<<i<<" ";
            cnt++;
            if(cnt%(n-1)==0)
            {
                fout<<"\n";
            }
        }
    }
}