{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\u003cb\u003eBackground\u003c/b\u003e\n\u003cbr\u003e你能帮助欧熙成为专业第一吗?\n\u003cbr\u003e\u003cb\u003eThe Problem\u003c/b\u003e\n\u003cbr\u003eYour task is to write a program to calculate the minimum number of moves needed for a knight to reach one point from another, so that you have the chance to be faster than Somurolov.\n\u003cbr\u003eFor people not familiar with chess, the possible knight moves are shown in Figure 1.\n\u003cbr\u003e\u003ccenter\u003e\u003cimg src\u003d\"CDN_BASE_URL/d2b26809455ce72d961db3fab309bf1a?v\u003d1629958044\"\u003e\u003c/center\u003e\n\u003cbr\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003eThe input begins with the number n of scenarios on a single line by itself.\n\u003cbr\u003eNext follow n scenarios. Each scenario consists of three lines containing integer numbers. The first line specifies the length l of a side of the chess board (4 \u0026lt;\u003d l \u0026lt;\u003d 300). The entire board has size l * l. The second and third line contain pair of integers {0, ..., l-1}*{0, ..., l-1} specifying the starting and ending position of the knight on the board. The integers are separated by a single blank. You can assume that the positions are valid positions on the chess board of that scenario.\u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003eFor each scenario of the input you have to calculate the minimal amount of knight moves which are necessary to move from the starting point to the ending point. If starting point and ending point are equal,distance is zero. The distance must be written on a single line.\u003c/div\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e3\n8\n0 0\n7 0\n100\n0 0\n30 50\n10\n1 1\n1 1\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e5\n28\n0\u003c/pre\u003e"}}]}