#include <stdio.h>
void array_mul(int (*x)[2], int (*y)[2], int (*ans)[2]);
int main(void) {
int x[2][2] = { {1,2}, {3,4} };
int y[2][2] = { {1,2}, {3,4} };
int ans[2][2] = { 0 };
array_mul(x, y, ans);
return 0;
}
void array_mul(int (*x)[2], int (*y)[2], int (*ans)[2]) {
for(int i=0;i<2;i++){
for(int j=0;j<2;j++){
ans[i][j] = x[0][j] * y[i][0] + x[1][j] * y[i][1];
}
}
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp2b2lkIGFycmF5X211bChpbnQgKCp4KVsyXSwgaW50ICgqeSlbMl0sIGludCAoKmFucylbMl0pOwoKaW50IG1haW4odm9pZCkgewoJaW50IHhbMl1bMl0gPSB7IHsxLDJ9LCB7Myw0fSB9OwoJaW50IHlbMl1bMl0gPSB7IHsxLDJ9LCB7Myw0fSB9OwoJaW50IGFuc1syXVsyXSA9IHsgMCB9OwoJCglhcnJheV9tdWwoeCwgeSwgYW5zKTsKCXJldHVybiAwOwp9Cgp2b2lkIGFycmF5X211bChpbnQgKCp4KVsyXSwgaW50ICgqeSlbMl0sIGludCAoKmFucylbMl0pIHsKCWZvcihpbnQgaT0wO2k8MjtpKyspewoJCWZvcihpbnQgaj0wO2o8MjtqKyspewoJCQlhbnNbaV1bal0gPSB4WzBdW2pdICogeVtpXVswXSArIHhbMV1bal0gKiB5W2ldWzFdOwoJCQlwcmludGYoIiVkXG4iLCBhbnNbaV1bal0pOwoJCX0KCX0KfQo=