## NAKANJC - Minimum knight moves Challenge

no tags

```Anjali and Nakul are good friends. They had quarrelled and you had written a program for Anjali to know the minimum number of moves a knight takes to reach from one square to another square of a chess board (8X8).
Nakul is brilliant and knows Anjali didn't write it herself and says her program is too slow by all standards. He is unimpressed so she asks you to try solve the problem faster this time using as few keystrokes as possible.She wants to know whether you can actually do it. Anjali is very weak in programming. Help her to solve the problem. Since you are busy and tend to forget she reminds you that "A knight can move in the shape of an "L" in a chessboard - two squares either forward, backward, left, or right and then one square to its left or right. A knight move is valid if it moves as mentioned above and it is within the boundary of the chessboard (8 X 8). Since you are busy and tend to forget she reminds you that-"A knight can move in the shape of an "L" in a chessboard - two squares either forward, backward, left,or right and then one square to its left or right. A knight move is valid if it moves as mentioned above andit is within the boundary of the chessboard (8 X 8)."first solve problem http://www.spoj.com/problems/NAKANJ/
InputThere are T test cases in total. The next T lines contain two strings (start and destination) separated by a space.T<=200001
The strings start and destination will only contain two characters - First character is an alphabet between 'a' and 'h' (inclusive), Second character is a digit between '1' and '8' (inclusive) - (Quotes just for clarity).
OutputPrint the minimum number of moves a knight takes to reach from start to destination in a separate line.
Example
Input:
3
a1 h8
a1 c2
h8 c3
Output:
614
Score:
Your source code length (if you are successful in avoiding TLE and WA)
The smaller code the better

EDIT: Time limit increased 28-11-2012. All submissions rejudged```