import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { final static int[][] dir = {{-2,-1},{-2,1},{0,2},{2,1},{2,-1},{0,-2}/*L*/}; final static String[] dirstr = {"UL","UR","R","LR","LL","L"}; static void printShortestPath(int n, int i_start, int j_start, int i_end, int j_end) { // Print the distance along with the sequence of moves. Queue queue = new LinkedList(); queue.offer(new int[]{i_start,j_start}); boolean[][] visited = new boolean[n][n]; visited[i_start][j_start] = true; Stack pathrec = new Stack(); int[][] path = new int[n][n]; boolean found = false; while(!queue.isEmpty()) { int[] top = queue.poll(); if(top[0] == i_end && top[1]==j_end) { // found shortest path found = true; break; } for(int d=0;d<6;d++) { int x = top[0]+dir[d][0]; int y = top[1]+dir[d][1]; if(x>=0&&x=0&&y