#include <stdio.h>
#include <stdlib.h>
int main(){
int i,j,k=1;
int a,b;
int **mat;
// 2次元配列の動的確保
mat
= (int **)malloc(a
* sizeof(int *)); for(i = 0; i < a; i++){
mat
[i
] = (int *)malloc(b
* sizeof(int)); }
// 数値を代入
for(i = 0; i < a; i++){
for(j = 0; j < b; j++){
mat[i][j] = k++;
}
}
// 出力(ここはいじらなくてOK)
for(i=0;i<a;i++){
for(j=0;j<b;j++){
}
}
// メモリ解放
for(i = 0; i < a; i++){
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KCmludCBtYWluKCl7CiAgICBpbnQgaSxqLGs9MTsKICAgIGludCBhLGI7CiAgICBpbnQgKiptYXQ7CiAgICBzY2FuZigiJWQgJWQiLCZhLCZiKTsKCiAgICAvLyAy5qyh5YWD6YWN5YiX44Gu5YuV55qE56K65L+dCiAgICBtYXQgPSAoaW50ICoqKW1hbGxvYyhhICogc2l6ZW9mKGludCAqKSk7CiAgICBmb3IoaSA9IDA7IGkgPCBhOyBpKyspewogICAgICAgIG1hdFtpXSA9IChpbnQgKiltYWxsb2MoYiAqIHNpemVvZihpbnQpKTsKICAgIH0KCiAgICAvLyDmlbDlgKTjgpLku6PlhaUKICAgIGZvcihpID0gMDsgaSA8IGE7IGkrKyl7CiAgICAgICAgZm9yKGogPSAwOyBqIDwgYjsgaisrKXsKICAgICAgICAgICAgbWF0W2ldW2pdID0gaysrOwogICAgICAgIH0KICAgIH0KCiAgICAvLyDlh7rlipvvvIjjgZPjgZPjga/jgYTjgZjjgonjgarjgY/jgaZPS++8iQogICAgZm9yKGk9MDtpPGE7aSsrKXsKICAgICAgICBmb3Ioaj0wO2o8YjtqKyspewogICAgICAgICAgICBwcmludGYoIiVkICIsbWF0W2ldW2pdKTsKICAgICAgICB9CiAgICAgICAgcHJpbnRmKCJcbiIpOwogICAgfQoKICAgIC8vIOODoeODouODquino+aUvgogICAgZm9yKGkgPSAwOyBpIDwgYTsgaSsrKXsKICAgICAgICBmcmVlKG1hdFtpXSk7CiAgICB9CiAgICBmcmVlKG1hdCk7CgogICAgcmV0dXJuIDA7Cn0K