import java.util.*; class Point{ int x, y; Point(int x, int y){ this.x=x; this.y=y; } } class Main { static int answer=0, n; static int[] dx={-1, -1, 0, 1, 1, 1, 0, -1}; static int[] dy={0, 1, 1, 1, 0, -1, -1, -1}; Queue queue = new LinkedList(); public void BFS(int x, int y, int[][] board){ queue.add(new Point(x, y)); while(!queue.isEmpty()){ Point pos = queue.poll(); for(int i=0; i=0 && nx=0 &..