#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 == NULL)
{
return 0;
}
}
k = 1;
for(i=0; i<a; i++)
{
for(j=0; j<b; j++)
{
mat[i][j] = k;
k++;
}
}
for(i=0;i<a; i++)
{
for(j=0;j<b;j++)
{
}
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KCmludCBtYWluKCl7CiAgICBpbnQgaSxqLGs7CiAgICBpbnQgYSxiOwogICAgaW50ICoqbWF0OwogICAgc2NhbmYoIiVkICVkIiwmYSwmYik7CgogICAgbWF0ID0gKGludCopbWFsbG9jKHNpemVvZihpbnQpICogYSk7CiAgICAKICAgIGlmKG1hdCA9PSBOVUxMKQogICAgewogICAgCXByaW50ZigiRVJST1JcbiIpOwoJCXJldHVybiAwOwogICAgfQogICAgCiAgICBmb3IoaT0wOyBpPGE7IGkrKykKICAgIHsKICAgIAltYXRbaV0gPSAoaW50KiltYWxsb2Moc2l6ZW9mKGludCkgKiBiKTsKICAgIAkKICAgIAlpZihtYXQgPT0gTlVMTCkKCQl7CiAgICAJCXByaW50ZigiRVJST1JcbiIpOwoJCQlyZXR1cm4gMDsKICAgIAl9CiAgICB9CgkKCWsgPSAxOwoJCglmb3IoaT0wOyBpPGE7IGkrKykKCXsKICAgICAgICBmb3Ioaj0wOyBqPGI7IGorKykKICAgICAgICB7CiAgICAgICAgCW1hdFtpXVtqXSA9IGs7CiAgICAgICAgCWsrKzsKICAgICAgICB9Cgl9CgkKICAgIGZvcihpPTA7aTxhOyBpKyspCgl7CiAgICAgICAgZm9yKGo9MDtqPGI7aisrKQogICAgICAgIHsKICAgICAgICAJcHJpbnRmKCIlZCAiLCBtYXRbaV1bal0pOwogICAgICAgIH0KICAgICAgICBwcmludGYoIlxuIik7Cgl9CiAgICAKCWZyZWUobWF0KTsKCiAgICByZXR1cm4gMDsKfQ==