#include <stdio.h>
#include <stdlib.h>
int main(){
int i,j,k;
int a,b;
int **mat;
mat
=(int **)malloc(sizeof(int *)*a
); if(mat==NULL){
return 0;
}
for(i=0;i<a;i++){
mat
[i
]=(int *)malloc(sizeof(int)*b
); if(mat[i]==NULL){
for(j=0;j<i;j++){
}
return 0;
}
}
k=1;
for(i=0;i<a;i++){
for(j=0;j<b;j++){
mat[i][j]=k++;
}
}
for(i=0;i<a;i++){
for(j=0;j<b;j++){
}
}
for(i=0;i<a;i++){
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KCmludCBtYWluKCl7CiAgICBpbnQgaSxqLGs7CiAgICBpbnQgYSxiOwogICAgaW50ICoqbWF0OwogICAgc2NhbmYoIiVkICVkIiwmYSwmYik7CgoJbWF0PShpbnQgKiopbWFsbG9jKHNpemVvZihpbnQgKikqYSk7CglpZihtYXQ9PU5VTEwpewoJCXByaW50ZigiRVJST1JcbiIpOwoJCXJldHVybiAwOwoJfQoJZm9yKGk9MDtpPGE7aSsrKXsKCQltYXRbaV09KGludCAqKW1hbGxvYyhzaXplb2YoaW50KSpiKTsKCQlpZihtYXRbaV09PU5VTEwpewoJCQlwcmludGYoIkVSUk9SXG4iKTsKCQkJZm9yKGo9MDtqPGk7aisrKXsKCQkJCWZyZWUobWF0W2pdKTsKCQkJfQoJCQlmcmVlKG1hdCk7CgkJCXJldHVybiAwOwoJCX0KCX0KICAgIAogICAgaz0xOwoJZm9yKGk9MDtpPGE7aSsrKXsKICAgICAgICBmb3Ioaj0wO2o8YjtqKyspewogICAgICAgIAltYXRbaV1bal09aysrOwogICAgICAgIH0KCX0KCQogICAgZm9yKGk9MDtpPGE7aSsrKXsKICAgICAgICBmb3Ioaj0wO2o8YjtqKyspewogICAgICAgICAgICBwcmludGYoIiVkICIsbWF0W2ldW2pdKTsKICAgICAgICB9CiAgICAgICAgcHJpbnRmKCJcbiIpOwogICAgfQogICAgCiAgICBmb3IoaT0wO2k8YTtpKyspewogICAgCWZyZWUobWF0W2ldKTsKICAgIH0KCWZyZWUobWF0KTsKCiAgICByZXR1cm4gMDsKfQo=