-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathC263A.java
More file actions
43 lines (34 loc) · 825 Bytes
/
Copy pathC263A.java
File metadata and controls
43 lines (34 loc) · 825 Bytes
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
39
40
41
42
43
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/**
* */
public class C263A {
/**
* @param args
*/
public static void main(String[] args) {
/**
Solution solution=new Solution(); */
BufferedReader reader =new BufferedReader(
new InputStreamReader(System.in)); // STDIN
try {
int yRow=0;
int xColumn=0;
for(int i=0;i!=5;i++){
String[] s=reader.readLine().split(" ", 5);
for(int j=0;j!=5;j++){
Integer value=Integer.valueOf(s[j].trim());
if(value==1){
yRow=i;
xColumn=j;
}
}
}
System.out.println(String.valueOf(Math.abs(yRow-2)+Math.abs(xColumn-2)));
reader.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}