It is the summer of 2007 and Dev is learning chess moves. After learning some basic movements of the bishop, a question clicks in his mind and now he is curious to find out what will be the minimum number of moves required to move a bishop from one position to the desired position if there is no other chess piece on the board. Your task is to help Dev to find the answer to his question so that after some years of consistent hard work he can become a 2000+ rated player on platforms like Lichess.
You have been given a square chessboard of size N×N along with the position coordinates of the Bishop (x1,y1) and the position coordinates of the target (x2,y2).
Your task is to find out the minimum steps a bishop will take to reach the target position. If it is not possible then print −1.
Note:
Print the single integer for each test case denotes the minimum number of moves bishop required to reach the target or −1 if it is impossible.