import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static int searchBfs(int goal, int s1, int s2){ ArrayList queue = new ArrayList(); queue.add(new Step(0,0,0)); int[][] marker = new int[25][25]; while(queue.size() > 0){ Step c = queue.get(0); queue.remove(0); if(c.isGoal(goal)){ return c.step; } else{ if(c.isOutArena(goal)){ continue; } if(marker[c.x][c.y] == -1){ continue; } marker[c.x][c.y] = -1; queue.add(new Step(c.x+s1, c.y+s2, c.step+1)); queue.add(new Step(c.x-s1, c.y+s2, c.step+1)); queue.add(new Step(c.x+s1, c.y-s2, c.step+1)); queue.add(new Step(c.x-s1, c.y-s2, c.step+1)); queue.add(new Step(c.x+s2, c.y+s1, c.step+1)); queue.add(new Step(c.x-s2, c.y+s1, c.step+1)); queue.add(new Step(c.x+s2, c.y-s1, c.step+1)); queue.add(new Step(c.x-s2, c.y-s1, c.step+1)); } } return -1; } public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int[][] result = new int[25][25]; for(int i = 1; i size || this.y < 0 || this.y > size){ return true; } return false; } }