-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path2163.java
38 lines (32 loc) · 803 Bytes
/
2163.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import java.io.IOException;
import java.util.Locale;
import java.util.Scanner;
/*
*
*/
public class Main {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
Locale.setDefault(Locale.US);
int n = sc.nextInt();
int m = sc.nextInt();
int k=0,l=0;
int matriz[][] = new int[n+5][m+5];
for(int i=0;i<n;i++) {
for(int j = 0; j<m;j++) {
matriz[i][j]=sc.nextInt();
}
}
for(int i=0;i<n;i++) {
for(int j = 0; j<m;j++) {
if(matriz[i][j]==42 && matriz[i+1][j]==7 && matriz[i-1][j]==7 &&matriz[i-1][j-1]==7 && matriz[i-1][j-1]==7 && matriz[i-1][j+1]==7
&& matriz[i+1][j-1]==7 && matriz[i+1][j]==7 && matriz[i+1][j+1]==7) {
k=i+1;
l=j+1;
}
}
}
System.out.println(k+" "+l);
sc.close();
}
}