#include using namespace std; #define ll long long #define rep(i,n) for(int i=0;i> N >> H; bool p2 = false; rep(i,10){ if(H==(1< divs; rep(i,N-1){ if(N%(i+1)==0){ rep(j,i+1) divs.push_back(i+1); } } rep(i,H){ rep(j,W){ ans[i][j] = divs[i*W+j]; } } if(p2){ rep(i,H){ rep(j,W){ cout << ans[i][j] << " "; } cout << endl; } } else{ rep(i,W){ rep(j,H){ cout << ans[j][i] << " "; } cout << endl; } } }