Cod sursa(job #1364215)

Utilizator Tokumei_no_KageFMI NEIMPORTANT Tokumei_no_Kage Data 27 februarie 2015 15:48:54
Problema Tablete Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.42 kb
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
using namespace std;

int main()
{ freopen("tablete.in","r",stdin);
  freopen("tablete.out","w",stdout);
  int n,k,i,j,c=0;

  cin>>n;
  cin>>k;
  cout<<n<<"\n";
  for(i=1;i<=n;i++)
  { for(j=1;j<=n;j++)
     { if(j<k)cout<<i+j+c<<" ";
         else cout<<2*(j+i+c)<<" ";
     }
     c++;
     cout<<"\n";
  }
    return 0;
}