#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;
k++;
}
}
//以下の部分は表示の部分です
//いじらなくてOK
for(i=0;i<a;i++){
for(j=0;j<b;j++){
}
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KCmludCBtYWluKCl7CiAgICBpbnQgaSxqLGs7CiAgICBpbnQgYSxiOwogICAgaW50ICoqbWF0OwogICAgc2NhbmYoIiVkICVkIiwmYSwmYik7CgoJCiAgICBtYXQgPSAoaW50ICoqKW1hbGxvYyhzaXplb2YoaW50ICopKmEpOwoJaWYobWF0ID09IE5VTEwpewoJCXByaW50ZigiRVJST1JcbiIpOwoJCXJldHVybiAwOwoJfQoKCWZvcihpID0gMDsgaSA8IGE7IGkrKyl7CgkJbWF0W2ldID0gKGludCAqKW1hbGxvYyhzaXplb2YoaW50KSpiKTsKCQlpZihtYXRbaV0gPT0gTlVMTCl7CgkJCXByaW50ZigiRVJST1JcbiIpOwoJCQlyZXR1cm4gMDsKCQl9Cgl9CiAgICAKCWs9MTsKCWZvcihpID0gMDsgaSA8IGE7IGkrKyl7CgkJZm9yKGogPSAwOyBqIDwgYjsgaisrKXsKCQkJbWF0W2ldW2pdID0gazsKCQkJaysrOwoJCX0KCX0KCQoJCiAgICAKICAgIC8v5Lul5LiL44Gu6YOo5YiG44Gv6KGo56S644Gu6YOo5YiG44Gn44GZCiAgICAvL+OBhOOBmOOCieOBquOBj+OBpk9LCiAgICBmb3IoaT0wO2k8YTtpKyspewogICAgICAgIGZvcihqPTA7ajxiO2orKyl7CiAgICAgICAgICAgIHByaW50ZigiJWQgIixtYXRbaV1bal0pOwogICAgICAgIH0KICAgICAgICBwcmludGYoIlxuIik7CiAgICB9CiAgICAKICAgIGZyZWUobWF0KTsKCgogICAgcmV0dXJuIDA7Cn0K