#include <stdio.h>
#include <stdlib.h>
//必要があれば変数などを追加してもOKです
int main(){
int i,j,k=1;
int a,b;
int **mat;
mat
= (int **)malloc( sizeof(int *)*a
); if (mat == NULL) {
return 1;
}
for (i = 0; i < a; i++) {
mat
[i
] = (int *)malloc(sizeof(int)*b
); if (mat[i] == NULL) {
return 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++){
}
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KCi8v5b+F6KaB44GM44GC44KM44Gw5aSJ5pWw44Gq44Gp44KS6L+95Yqg44GX44Gm44KCT0vjgafjgZkKCmludCBtYWluKCl7CiAgICBpbnQgaSxqLGs9MTsKICAgIGludCBhLGI7CiAgICBpbnQgKiptYXQ7CiAgICBzY2FuZigiJWQgJWQiLCZhLCZiKTsKCiAgIG1hdCA9IChpbnQgKiopbWFsbG9jKCBzaXplb2YoaW50ICopKmEpOwogICAgaWYgKG1hdCA9PSBOVUxMKSB7CiAgICAgICAgcHJpbnRmKCLjg6Hjg6Ljg6rlibLjgorlvZPjgabjgavlpLHmlZfjgZfjgb7jgZfjgZ9cbiIpOwogICAgICAgIHJldHVybiAxOwogICAgfQogICAgZm9yIChpID0gMDsgaSA8IGE7IGkrKykgewogICAgICAgIG1hdFtpXSA9IChpbnQgKiltYWxsb2Moc2l6ZW9mKGludCkqYik7CiAgICAgICAgaWYgKG1hdFtpXSA9PSBOVUxMKSB7CiAgICAgICAgICAgIHByaW50Zigi44Oh44Oi44Oq5Ymy44KK5b2T44Gm44Gr5aSx5pWX44GX44G+44GX44GfXG4iKTsKICAgICAgICAgICAgcmV0dXJuIDE7CiAgICAgICAgfQogICAgfQogZm9yKGk9MDtpPGE7aSsrKXsKICAgICAgICBmb3Ioaj0wO2o8YjtqKyspewogICAgICAgICAgICBtYXRbaV1bal09aysrOwogICAgICAgIH0KICAgCiAgICB9CiAgICAKICAgIGZvcihpPTA7aTxhO2krKyl7CiAgICAgICAgZm9yKGo9MDtqPGI7aisrKXsKICAgICAgICAgICAgcHJpbnRmKCIlZCAiLG1hdFtpXVtqXSk7CiAgICAgICAgfQogICAgICAgIHByaW50ZigiXG4iKTsKICAgIH0KICAgIAogICAgZnJlZShtYXQpOwoKCiAgICByZXR1cm4gMDsKfQo=