{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cstyle type\u003d\"text/css\"\u003e\r\nh1,h2,h3,h4,h5,h6{margin-bottom:0;}div.textBG p{margin: 0 0 0.0001pt;}\u003c/style\u003e\r\n\u003cp\u003e\r\n\t\u0026nbsp;\u003c/p\u003e\r\n\u003cp\u003e\r\n\tA friend of you is doing research on the \u003cem\u003eTraveling Knight Problem (\u003cspan data-scayt_word\u003d\"TKP\" data-scaytid\u003d\"1\"\u003eTKP\u003c/span\u003e)\u003c/em\u003e where you are to find the shortest closed tour of knight moves that visits each square of a given set of \u003ci\u003en\u003c/i\u003e squares on a chessboard exactly once. He thinks that the most difficult part of the problem is determining the smallest number of knight moves between two given squares and that, once you have accomplished this, finding the tour would be easy.\u003c/p\u003e\r\n\u003cp\u003e\r\n\tOf course you know that it is vice versa. So you offer him to write a program that solves the \u0026quot;difficult\u0026quot; part.\u003c/p\u003e\r\n\u003cp\u003e\r\n\t\u0026nbsp;\u003c/p\u003e\r\n\u003cp\u003e\r\n\tYour job is to write a program that takes two squares \u003ci\u003ea\u003c/i\u003e and \u003ci\u003eb\u003c/i\u003e as input and then determines the number of knight moves on a shortest route from \u003ci\u003ea\u003c/i\u003e to \u003ci\u003eb\u003c/i\u003e.\u003c/p\u003e\r\n\u003cp\u003e\r\n\t\u0026nbsp;\u003c/p\u003e\r\n\u003ch2\u003e\r\n\t\u003cfont color\u003d\"#0070E8\"\u003e\u003ca name\u003d\"SECTION0001001000000000000000\"\u003eInput Specification\u003c/a\u003e\u003c/font\u003e\u003c/h2\u003e\r\n\u003cp\u003e\r\n\tThe input file will contain one or more test cases. Each test case consists of one line containing two squares separated by one space. A square is a string consisting of a letter (\u003ctt\u003ea-h\u003c/tt\u003e) representing the column and a digit (\u003ctt\u003e1-8\u003c/tt\u003e) representing the row on the chessboard.\u003c/p\u003e\r\n\u003cp\u003e\r\n\t\u0026nbsp;\u003c/p\u003e\r\n\u003ch2\u003e\r\n\t\u003cfont color\u003d\"#0070E8\"\u003e\u003ca name\u003d\"SECTION0001002000000000000000\"\u003eOutput Specification\u003c/a\u003e\u003c/font\u003e\u003c/h2\u003e\r\n\u003cp\u003e\r\n\tFor each test case, print one line saying \u0026quot;\u003ctt\u003eTo get from \u003ci\u003exx\u003c/i\u003e to \u003ci\u003e\u003cspan data-scayt_word\u003d\"yy\" data-scaytid\u003d\"2\"\u003eyy\u003c/span\u003e\u003c/i\u003e takes \u003ci\u003en\u003c/i\u003e knight moves.\u003c/tt\u003e\u0026quot;.\u003c/p\u003e\r\n\u003cp\u003e\r\n\t\u0026nbsp;\u003c/p\u003e\r\n\u003ch2\u003e\r\n\t\u003cfont color\u003d\"#0070E8\"\u003e\u003ca name\u003d\"SECTION0001003000000000000000\"\u003eSample Input\u003c/a\u003e\u003c/font\u003e\u003c/h2\u003e\r\n\u003cp\u003e\r\n\t\u0026nbsp;\u003c/p\u003e\r\n\u003cpre\u003e\r\n\u003cspan data-scayt_word\u003d\"e2\" data-scaytid\u003d\"3\"\u003ee2\u003c/span\u003e \u003cspan data-scayt_word\u003d\"e4\" data-scaytid\u003d\"4\"\u003ee4\u003c/span\u003e\r\n\u003cspan data-scayt_word\u003d\"a1\" data-scaytid\u003d\"5\"\u003ea1\u003c/span\u003e \u003cspan data-scayt_word\u003d\"b2\" data-scaytid\u003d\"9\"\u003eb2\u003c/span\u003e\r\n\u003cspan data-scayt_word\u003d\"b2\" data-scaytid\u003d\"10\"\u003eb2\u003c/span\u003e \u003cspan data-scayt_word\u003d\"c3\" data-scaytid\u003d\"11\"\u003ec3\u003c/span\u003e\r\n\u003cspan data-scayt_word\u003d\"a1\" data-scaytid\u003d\"6\"\u003ea1\u003c/span\u003e \u003cspan data-scayt_word\u003d\"h8\" data-scaytid\u003d\"13\"\u003eh8\u003c/span\u003e\r\n\u003cspan data-scayt_word\u003d\"a1\" data-scaytid\u003d\"7\"\u003ea1\u003c/span\u003e \u003cspan data-scayt_word\u003d\"h7\" data-scaytid\u003d\"15\"\u003eh7\u003c/span\u003e\r\n\u003cspan data-scayt_word\u003d\"h8\" data-scaytid\u003d\"14\"\u003eh8\u003c/span\u003e \u003cspan data-scayt_word\u003d\"a1\" data-scaytid\u003d\"8\"\u003ea1\u003c/span\u003e\r\n\u003cspan data-scayt_word\u003d\"b1\" data-scaytid\u003d\"16\"\u003eb1\u003c/span\u003e \u003cspan data-scayt_word\u003d\"c3\" data-scaytid\u003d\"12\"\u003ec3\u003c/span\u003e\r\n\u003cspan data-scayt_word\u003d\"f6\" data-scaytid\u003d\"17\"\u003ef6\u003c/span\u003e \u003cspan data-scayt_word\u003d\"f6\" data-scaytid\u003d\"18\"\u003ef6\u003c/span\u003e\u003c/pre\u003e\r\n\u003cp\u003e\r\n\t\u0026nbsp;\u003c/p\u003e\r\n\u003ch2\u003e\r\n\t\u003cfont color\u003d\"#0070E8\"\u003e\u003ca name\u003d\"SECTION0001004000000000000000\"\u003eSample Output\u003c/a\u003e\u003c/font\u003e\u003c/h2\u003e\r\n\u003cp\u003e\r\n\t\u0026nbsp;\u003c/p\u003e\r\n\u003cpre\u003e\r\nTo get from \u003cspan data-scayt_word\u003d\"e2\" data-scaytid\u003d\"19\"\u003ee2\u003c/span\u003e to \u003cspan data-scayt_word\u003d\"e4\" data-scaytid\u003d\"20\"\u003ee4\u003c/span\u003e takes 2 knight moves.\r\nTo get from \u003cspan data-scayt_word\u003d\"a1\" data-scaytid\u003d\"21\"\u003ea1\u003c/span\u003e to \u003cspan data-scayt_word\u003d\"b2\" data-scaytid\u003d\"25\"\u003eb2\u003c/span\u003e takes 4 knight moves.\r\nTo get from \u003cspan data-scayt_word\u003d\"b2\" data-scaytid\u003d\"26\"\u003eb2\u003c/span\u003e to \u003cspan data-scayt_word\u003d\"c3\" data-scaytid\u003d\"27\"\u003ec3\u003c/span\u003e takes 2 knight moves.\r\nTo get from \u003cspan data-scayt_word\u003d\"a1\" data-scaytid\u003d\"22\"\u003ea1\u003c/span\u003e to \u003cspan data-scayt_word\u003d\"h8\" data-scaytid\u003d\"29\"\u003eh8\u003c/span\u003e takes 6 knight moves.\r\nTo get from \u003cspan data-scayt_word\u003d\"a1\" data-scaytid\u003d\"23\"\u003ea1\u003c/span\u003e to \u003cspan data-scayt_word\u003d\"h7\" data-scaytid\u003d\"31\"\u003eh7\u003c/span\u003e takes 5 knight moves.\r\nTo get from \u003cspan data-scayt_word\u003d\"h8\" data-scaytid\u003d\"30\"\u003eh8\u003c/span\u003e to \u003cspan data-scayt_word\u003d\"a1\" data-scaytid\u003d\"24\"\u003ea1\u003c/span\u003e takes 6 knight moves.\r\nTo get from \u003cspan data-scayt_word\u003d\"b1\" data-scaytid\u003d\"32\"\u003eb1\u003c/span\u003e to \u003cspan data-scayt_word\u003d\"c3\" data-scaytid\u003d\"28\"\u003ec3\u003c/span\u003e takes 1 knight moves.\r\nTo get from \u003cspan data-scayt_word\u003d\"f6\" data-scaytid\u003d\"33\"\u003ef6\u003c/span\u003e to \u003cspan data-scayt_word\u003d\"f6\" data-scaytid\u003d\"34\"\u003ef6\u003c/span\u003e takes 0 knight moves.\u003c/pre\u003e"}}]}