#include <stdio.h>
int main(void) {
int i,n,m,**a;
a
=(int**)malloc(sizeof(int*)*n
); for(i=0;i<n;i++){
a
[i
]=(int*)malloc(sizeof(int)); }
for(i=0;i<n;i++){
for(int j=0;j<m;j++){
a[i][j]=i*m+j;
}
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbih2b2lkKSB7CglpbnQgaSxuLG0sKiphOwoJc2NhbmYoIiVkICVkIiwmbiwmbSk7CglhPShpbnQqKiltYWxsb2Moc2l6ZW9mKGludCopKm4pOwoJZm9yKGk9MDtpPG47aSsrKXsKCQlhW2ldPShpbnQqKW1hbGxvYyhzaXplb2YoaW50KSk7Cgl9Cglmb3IoaT0wO2k8bjtpKyspewoJCWZvcihpbnQgaj0wO2o8bTtqKyspewoJCQlhW2ldW2pdPWkqbStqOwoJCQlwcmludGYoIiUzZCIsYVtpXVtqXSk7CgkJfQoJCXByaW50ZigiXG4iKTsKCX0KCXJldHVybiAwOwp9Cg==