9037 - Knight Moves   

Description

A knight can move in eight directions on a 8x8 chess board as shown in fig. 1. Your job is to write a program that takes two coordinates a and b as input and then count the number of knight moves on a shortest route from a to b, on a 10x10 chess board.  

Input

The input consists of several test cases. In each test case, there are four integers x1, y1, x2 and y2., where x1 and y1 represents the start point, and x2 and y2 represents the end point. ( 1 <= x1, y1, x2, y2 <= 10)

Output

For each test case, print one line saying “To get from (x1,y1) to (x2,y2) takes n knight moves”.

Sample Input  Download

Sample Output  Download

Tags




Discuss