Problem description.
Chris brown and Rihanna are in a nxn grid(1 indexed). Chris brown want to reach Rihanna in minimum number of moves but the thing is he can move only diagonally and whatever may be the number of steps he takes it is considered as only one move unless he takes a turn. So in one move he can take as many steps as he wants but should not take a turn, if he takes a turn it is considered as another move. 

Input
First line has integer T, the number of test cases
In each test case first line contains integer n
Next line contains 4 integers x1, y1, x2, y2  first two are the co-ordinates of chris brown and the next two are co-ordinates of rihanna.
 

Output
 Print the minimum number of moves.
If he can’t reach print  -1


Constraints
1<=T<=50000
1<=n<= 2^64 - 1  
1<=x1,y1,x2,y2<=n
 

Example
Input:
2
4
1 1 3 3 
4
1 1 1 3

Output:
1
2
t=int(input())
for i in range(t):
    n=int(input())
    [a,b,c,d]=map(int,raw_input().split())
    if a==c and b==d:
        ans=0
    elif (a+b)%2 == (c+d)%2:
        ac=max(a,c)-min(a,c)
        bd=max(b,d)-min(b,d)
        if (a+b)==(c+d) or ac==bd:
            ans=1
        else:
            ans=2
    else:
        ans=-1
    print ans