41 lines
879 B
C
41 lines
879 B
C
|
#include<stdio.h>
|
||
|
|
||
|
int main(){
|
||
|
int a[10][10],b[10][10],n1,n2,temp;
|
||
|
|
||
|
scanf("%d",&n1);
|
||
|
for(int i=0;i<n1;i++){
|
||
|
for(int j=0;j<n1;j++){
|
||
|
scanf("%d",&a[i][j]);
|
||
|
}
|
||
|
}
|
||
|
scanf("%d",&n2);
|
||
|
for(int i=0;i<n2;i++){
|
||
|
for(int j=0;j<n2;j++){
|
||
|
scanf("%d",&b[i][j]);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
for(int i=0;i<n1-n2+1;i++){
|
||
|
for(int j=0;j<n1-n2+1;j++){
|
||
|
if(a[i][j]==b[0][0]){
|
||
|
temp = 1;
|
||
|
for(int k=0;k<n2;k++){
|
||
|
for(int l=0;l<n2;l++){
|
||
|
if(a[i+k][j+l]!=b[k][l]){
|
||
|
temp = 0;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
if(temp==1){
|
||
|
printf("%d,%d",i+1,j+1);
|
||
|
return 0;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
printf("-1");
|
||
|
return 0;
|
||
|
}
|