#include <stdio.h>
#include <stdlib.h>
int main(void) {
int** m;
int row,col;
int num=0;
scanf("%d %d",&row
,&col
);
m
=(int**)malloc(sizeof(int*)*row
);
if(m==NULL){
return 0;
}
for(int i=0;i<row;i++){
m
[i
]=(int*)malloc(sizeof(int)*col
); if(m[i]==NULL){
}
}
for(int i=0;i<row;i++){
for(int j=0;j<col;j++){
num++;
m[i][j]=num;
}
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KCmludCBtYWluKHZvaWQpIHsKCWludCoqIG07CglpbnQgcm93LGNvbDsKCWludCBudW09MDsKCXNjYW5mKCIlZCAlZCIsJnJvdywmY29sKTsKCQoJbT0oaW50KiopbWFsbG9jKHNpemVvZihpbnQqKSpyb3cpOwoJCglpZihtPT1OVUxMKXsKCQlwcmludGYoIm0gaXMgRVJST1IiKTsKCQlyZXR1cm4gMDsKCX0KCQoJZm9yKGludCBpPTA7aTxyb3c7aSsrKXsKCQltW2ldPShpbnQqKW1hbGxvYyhzaXplb2YoaW50KSpjb2wpOwoJCWlmKG1baV09PU5VTEwpewoJCQlwcmludGYoIm1baV0gaXMgRVJST0UiKTsKCQl9Cgl9CgkKCWZvcihpbnQgaT0wO2k8cm93O2krKyl7CgkJZm9yKGludCBqPTA7ajxjb2w7aisrKXsKCQkJbnVtKys7CgkJCW1baV1bal09bnVtOwoJCQlwcmludGYoIiUyZCAiLG1baV1bal0pOwoJCX0KCXByaW50ZigiXG4iKTsKCX0KCQoJCglmcmVlKG0pOwoJcmV0dXJuIDA7Cn0K