Ameya and his Chess Problem

All submissions for this problem are available.
Ameya is a chess wiz. On an eventful day he only places $3$ pieces  the Rook, Bishop and the King. Now to brush up the rules of moving the chess pieces. A chessboard contains $64$ square blocks organized into an $8 * 8$ table  half of the blocks being black and other half being white. A block is represented by a pair of integers ($x$,$y$)  the row number and the column number (we are not taking the classical representation indexed by letters). Each chess piece occupies only one field. The 3 pieces move according to the following rules: 1. A king moves one block in any direction  horizontally, vertically or diagonally. 2. A rook moves any number of blocks horizontally or vertically. 3. A bishop moves any number of blocks diagonally. ![Image](https://i2.wp.com/www.familygamestreasurehouse.com/images/Chess_Moves_...) ![Image](https://i0.wp.com/www.familygamestreasurehouse.com/images/Chess_Moves_...) ![Image](https://i2.wp.com/www.familygamestreasurehouse.com/images/Chess_Moves_...) Now it is given that there are no other pieces on the board. Ameya needs to find the minimum number of moves for each of these pieces to move from block ($x_1$,$y_1$) to block ($x_2$,$y_2$) ###Input:  The input contains 4 integers $x_1$,$y_1$,$x_2$,$y_2$  which corresponds to starting block and final block respectively. The start does not coincide with the end.  Assumption: The rows of the board are numbered 1 through 8 from top to bottom, the columns are numbered 1 through 8 from left to right. ###Output:  Output 3 space seperated integers : the minimum number if moves needed by the 3 pieces to move from block ($x_1$,$y_1$) to block ($x_2$,$y_2$)  Note : Rook, Bishop and King  output order ###Constraints  $1 \leq x_1, y_1, x_2, y_2 \leq 8$ ###Sample Input 1: 8 1 1 1 ###Sample Output 1: 1 0 7 ###Sample Input 1: 1 7 5 4 ###Sample Output 1: 2 0 4Author:  sourav2999 
Tags  sourav2999 
Date Added:  20122019 
Time Limit:  1 sec 
Source Limit:  50000 Bytes 
Languages:  C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, SQL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions
HELP
If you are still having problems, see a sample solution here. 