Wabbit is trying to move a box containing food for the rest of the zoo in the coordinate plane from the point $(x_1,y_1)$ to the point $(x_2,y_2)$.

He has a rope, which he can use to pull the box. He can only pull the box if he stands exactly $1$ unit away from the box in the direction of one of two coordinate axes. He will pull the box to where he is standing before moving out of the way in the same direction by $1$ unit.  [Image] 

For example, if the box is at the point $(1,2)$ and Wabbit is standing at the point $(2,2)$, he can pull the box right by $1$ unit, with the box ending up at the point $(2,2)$ and Wabbit ending at the point $(3,2)$.

Also, Wabbit can move $1$ unit to the right, left, up, or down without pulling the box. In this case, it is not necessary for him to be in exactly $1$ unit away from the box. If he wants to pull the box again, he must return to a point next to the box. Also, Wabbit can't move to the point where the box is located.

Wabbit can start at any point. It takes $1$ second to travel $1$ unit right, left, up, or down, regardless of whether he pulls the box while moving.

Determine the minimum amount of time he needs to move the box from $(x_1,y_1)$ to $(x_2,y_2)$. Note that the point where Wabbit ends up at does not matter.


-----Input-----

Each test contains multiple test cases. The first line contains a single integer $t$ $(1 \leq t \leq 1000)$: the number of test cases. The description of the test cases follows.

Each of the next $t$ lines contains four space-separated integers $x_1, y_1, x_2, y_2$ $(1 \leq x_1, y_1, x_2, y_2 \leq 10^9)$, describing the next test case.


-----Output-----

For each test case, print a single integer: the minimum time in seconds Wabbit needs to bring the box from $(x_1,y_1)$ to $(x_2,y_2)$.


-----Example-----
Input
2
1 2 2 2
1 1 2 2

Output
1
4



-----Note-----

In the first test case, the starting and the ending points of the box are $(1,2)$ and $(2,2)$ respectively. This is the same as the picture in the statement. Wabbit needs only $1$ second to move as shown in the picture in the statement.

In the second test case, Wabbit can start at the point $(2,1)$. He pulls the box to $(2,1)$ while moving to $(3,1)$. He then moves to $(3,2)$ and then to $(2,2)$ without pulling the box. Then, he pulls the box to $(2,2)$ while moving to $(2,3)$. It takes $4$ seconds.

Difficulty: competition

Starter code:

Solutions:
for __ in range(int(input())):
    a, b, c, d = list(map(int, input().split()))
    if a == c or b == d:
        print(abs(a - c) + abs(b - d))
    else:
        print(abs(a - c) + abs(b - d) + 2)

t = int(input())
for i in range(t):
    x1, y1, x2, y2 = map(int, input().split())
    if x1 == x2 or y1 == y2:
        print(abs(x1 - x2) + abs(y1 - y2))
    else:
        print(abs(x1 - x2) + abs(y1 - y2) + 2)

def solve():
    x1,y1,x2,y2 =map(int,input().split())
    t = 0
    ans = 0
    if x1 != x2:
        ans += abs(x1 -x2)
        t += 1
    if y1 != y2:
        ans += abs(y1-y2)
        t += 1
    print(ans + max(t-1,0) * 2)
for i in range(int(input())):
    solve()

T = int(input())

for t in range(T):
    x1, y1, x2, y2 = [int(_) for _ in input().split()]
    if x1 == x2 or y1 == y2:
        print(abs(x2-x1) + abs(y2-y1))
    else:
        print(abs(x2-x1) + abs(y2-y1) + 2)


import math

T = int(input())

#lets = 'abcdefghijklmnopqrstuvwxyz'
#key = {lets[i]:i for i in range(26)}

for t in range(T):
  #n = int(input())
  x1,y1,x2,y2 = list(map(int,input().split()))
  #a = list(map(int,input().split()))
  #a = list(input())
  d = False
  print(abs(x1-x2)+abs(y2-y1)+2*((y2!=y1)*(x2!=x1)))



t = int(input())

for i in range(t):
    x1, y1, x2, y2 = list(map(int, input().split()))
    dx = abs(x1 - x2)
    dy = abs(y1 - y2)
    if dx == 0 and dy == 0:
        print(0)
    elif dx == 0 or dy == 0:
        print(max(dx, dy))
    else:
        print(dx + dy + 2)

t=int(input())
for _ in range(t):
    x,y,a,b=map(int,input().split())
    if x==a:
        print(abs(y-b))
    elif y==b:
        print(abs(x-a))
    else:
        print(abs(x-a)+abs(y-b)+2)

def main():
    # n = int(input())
    # arr = list(map(int, input().split()))
    x1, y1, x2, y2 = list(map(int, input().split()))
    # s = input()
    if x1 == x2 or y1 == y2:
        print(abs(x1 - x2) + abs(y1 - y2))
    else:
        print(abs(x1 - x2) + abs(y1 - y2) + 2)



# for _ in range(1):
for _ in range(int(input())):
    main()


from sys import stdin

for _ in range(int(stdin.readline())):
    x1,y1,x2,y2 = map(int, stdin.readline().split())
    ans = abs(x2 -x1) + abs(y2 - y1)
    if x1 != x2 and y1 != y2:
        ans += 2
    print(ans)

def testcase():

    x1, y1, x2, y2 = map(int, input().split())
    x = abs(x1 - x2)
    y = abs(y1 - y2)
    ans = x + y
    if x > 0 and y > 0:
        ans += 2
    print(ans)

    return

t = int(input())
for _ in range(t):
    testcase()

import sys
readline = sys.stdin.readline

T = int(readline())
Ans = [None]*T
for qu in range(T):
    x1, y1, x2, y2 = list(map(int, readline().split()))
    if x1 == x2 or y1 == y2:
        Ans[qu] = abs(x1-x2)+abs(y1-y2)
    else:
        Ans[qu] = abs(x1-x2)+abs(y1-y2) + 2

print('\n'.join(map(str, Ans)))


import sys
import random
# import numpy as np
import math
import copy
from heapq import heappush, heappop, heapify
from functools import cmp_to_key
from bisect import bisect_left, bisect_right
from collections import defaultdict, deque, Counter

# sys.setrecursionlimit(1000000)
# input aliases
input = sys.stdin.readline
getS = lambda: input().strip()
getN = lambda: int(input())
getList = lambda: list(map(int, input().split()))
getZList = lambda: [int(x) - 1 for x in input().split()]

INF = float("inf")

MOD = 10 ** 9 + 7
divide = lambda x: pow(x, MOD - 2, MOD)


def solve():
    a,b, x,y = getList()
    if a == x:
        print(abs(b - y))
        return
    if b == y:
        print(abs(a - x))
        return

    print(abs(a - x) + abs(b - y) + 2)



def main():
    n = getN()
    for _ in range(n):
        solve()

    return


def __starting_point():
    main()
    # solve()

__starting_point()

def read_int():
    return int(input())


def read_ints():
    return list(map(int, input().split(' ')))


t = read_int()
for case_num in range(t):
    x1, y1, x2, y2 = read_ints()
    if x1 == x2 or y1 == y2:
        print(abs(x1 - x2) + abs(y1 - y2))
    else:
        print(abs(x1 - x2) + abs(y1 - y2) + 2)


import sys
input = lambda : sys.stdin.readline().rstrip()
read = lambda: list(map(int, input().split()))

def solve():
  x1, y1, x2, y2 = read()
  if x1 == x2:
    print(abs(y1 - y2))
  elif y1 == y2:
    print(abs(x1 - x2))
  else:
    print(abs(y1 - y2) + abs(x1 - x2) + 2)
  

for t in range(int(input())):
  solve()

t = int(input())
for _ in range(t):
	x1, y1, x2, y2 = map(int, input().split())

	if x1 == x2:
		print(abs(y1-y2))
	elif y1 == y2:
		print(abs(x1-x2))
	else:
		print(abs(x1-x2) + abs(y1-y2) + 2)

q = int(input())
for _ in range(q):
	x1,y1,x2,y2 = map(int, input().split())
	if x1 == x2:
		print(abs(y2-y1))
	elif y1 == y2:
		print(abs(x2-x1))
	else:
		print(abs(x2-x1)+abs(y2-y1)+2)