#include<bits/stdc++.h>
//if bits doesnt work,
//try changing to #include<iostream>
using namespace std;
int main(){
int tc; cin >> tc;
for (int i = 1; i <= tc; i++){
int X1, Y1, X2, Y2;
cin >> X1 >> Y1 >> X2 >> Y2;
if (X1 != X2 && Y1 != Y2){
cout << abs(X1-X2) + abs(Y2-Y1) + 2 << endl;
}
else{
cout << abs(X1-X2) + abs(Y2-Y1) << endl;
}
}
}
/*
If you are inputing with python,
you can use something like this:
w = int(input())
for multiple variables in a line, you can do:
x1, y1, x2, y2 = list(map(int, input().split(" ")))
*/
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KLy9pZiBiaXRzIGRvZXNudCB3b3JrLAovL3RyeSBjaGFuZ2luZyB0byAjaW5jbHVkZTxpb3N0cmVhbT4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCl7CiAgICBpbnQgdGM7IGNpbiA+PiB0YzsKICAgIGZvciAoaW50IGkgPSAxOyBpIDw9IHRjOyBpKyspewogICAgICAgIGludCBYMSwgWTEsIFgyLCBZMjsKICAgICAgICBjaW4gPj4gWDEgPj4gWTEgPj4gWDIgPj4gWTI7CgogICAgICAgIGlmIChYMSAhPSBYMiAmJiBZMSAhPSBZMil7CiAgICAgICAgICAgIGNvdXQgPDwgYWJzKFgxLVgyKSArIGFicyhZMi1ZMSkgKyAyIDw8IGVuZGw7CiAgICAgICAgfQogICAgICAgIGVsc2V7CiAgICAgICAgICAgIGNvdXQgPDwgYWJzKFgxLVgyKSArIGFicyhZMi1ZMSkgPDwgZW5kbDsKICAgICAgICB9CiAgICB9Cn0KCi8qCklmIHlvdSBhcmUgaW5wdXRpbmcgd2l0aCBweXRob24sCnlvdSBjYW4gdXNlIHNvbWV0aGluZyBsaWtlIHRoaXM6Cgp3ID0gaW50KGlucHV0KCkpCgpmb3IgbXVsdGlwbGUgdmFyaWFibGVzIGluIGEgbGluZSwgeW91IGNhbiBkbzoKeDEsIHkxLCB4MiwgeTIgPSBsaXN0KG1hcChpbnQsIGlucHV0KCkuc3BsaXQoIiAiKSkpCgoqLw==