#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){
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+CiNpbmNsdWRlIDxzdGRsaWIuaD4KCmludCBtYWluKCl7CiAgICBpbnQgaSxqLGs7CiAgICBpbnQgYSxiOwogICAgaW50ICoqbWF0OwogICAgc2NhbmYoIiVkICVkIiwmYSwmYik7CgogICAgbWF0ID0gKGludCAqKiltYWxsb2Moc2l6ZW9mKGludCAqKSphKTsKICAgIGlmKG1hdCA9PSBOVUxMKXsKICAgICAgICBwcmludGYoIkVSUk9SXG4iKTsKICAgICAgICByZXR1cm4gMDsKICAgIH0KICAgIGZvcihpPTA7aTxhO2krKyl7CiAgICAgICAgbWF0W2ldID0gKGludCAqKW1hbGxvYyhzaXplb2YoaW50KSpiKTsKICAgICAgICBpZihtYXRbaV0gPT0gTlVMTCl7CiAgICAgICAgICAgIHByaW50ZigiRVJST1JcbiIpOwogICAgICAgICAgICByZXR1cm4gMDsKICAgICAgICB9CiAgICB9CiAgICBrID0gMTsKICAgIGZvcihpPTA7aTxhO2krKyl7CiAgICAgICAgZm9yKGo9MDtqPGI7aisrKXsKICAgICAgICAgICAgbWF0W2ldW2pdID0gaysrOwogICAgICAgIH0KICAgIH0KICAgIGZvcihpPTA7aTxhO2krKyl7CiAgICAgICAgZm9yKGo9MDtqPGI7aisrKXsKICAgICAgICAgICAgcHJpbnRmKCIlZCAiLG1hdFtpXVtqXSk7CiAgICAgICAgfQogICAgICAgIHByaW50ZigiXG4iKTsKICAgIH0KICAgIGZvcihpPTA7aTxhO2krKyl7CiAgICAgICAgZnJlZShtYXRbaV0pOwogICAgfQogICAgZnJlZShtYXQpOwogICAgcmV0dXJuIDA7Cn0K