import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static int [][] minMoves ; //static int [][] op ; static boolean[][] visited ; static int nodesVisited =0; static int n; public static void visit(int x, int y, int dx, int dy, int moves){ visited[x][y]=true; minMoves [x][y]= moves; //System.out.println(x+"x y"+y+" moves"+moves); if(x==0&&y==0) return; if(visited[0][0] && moves>=minMoves[0][0]) return; int mxx = x-dx; int mxy =x-dy; int pxx = x+dx; int pxy = x+dy; int myx = y-dx; int myy =y-dy; int pyx=y+dx; int pyy=y+dy; if(pxx-1){ if(!visited[pxx][myy]||moves+1-1){ if(pyy-1){ if(!visited[mxx][myy]||moves+1-1){ if(!visited[pxy][myx]||moves+1-1){ if(pyx-1){ if(!visited[mxy][myx]||moves+1