#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
bool prime(long long int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
bool isPerfectSquare(long long int x) {
  long double sr = sqrt(x);
  return ((sr - floor(sr)) == 0);
}
bool isPowerOfTwo(long long int n) { return n > 0 && !(n & (n - 1)); }
bool subsequence_checker(string str1, string str2, long long int m,
                         long long int n) {
  if (m == 0) return true;
  if (n == 0) return false;
  if (str1[m - 1] == str2[n - 1])
    return subsequence_checker(str1, str2, m - 1, n - 1);
  return subsequence_checker(str1, str2, m, n - 1);
}
bool cmp(const pair<long long int, long long int> &a,
         const pair<long long int, long long int> &b) {
  if (a.first == b.first) return a.second < b.second;
  return (a.first > b.first);
}
long long int gcd(long long int p, long long int q) {
  if (p % q == 0) return q;
  return gcd(q, p % q);
}
long long int getSumofdigit(long long int n) {
  long long int sum = 0;
  while (n != 0) {
    sum = sum + n % 10;
    n = n / 10;
  }
  return sum;
}
long long int countDigit(long long int n) { return floor(log10(n) + 1); }
long long int printDivisors(long long int n) {
  long long int count = 0;
  for (long long int i = 1; i * i < n; i++) {
    if (n % i == 0) count++;
  }
  for (long long int i = sqrt(n); i >= 1; i--) {
    if (n % i == 0) count++;
  }
  return count;
}
long long int setBitNumber(long long int n) {
  n |= n >> 1;
  n |= n >> 2;
  n |= n >> 4;
  n |= n >> 8;
  n |= n >> 16;
  n = n + 1;
  return (n >> 1);
}
void solve() {
  long long int x, y, p, q;
  cin >> x >> y >> p >> q;
  if (x == p and y == q) {
    cout << 0;
    return;
  }
  long long int ans = 0;
  if (x != p and y == q) {
    cout << abs(x - p);
    return;
  }
  if (y != q and x == p) {
    cout << abs(y - q);
    return;
  }
  ans += (abs(x - p) + abs(y - q) + 2);
  cout << ans;
  return;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int t;
  cin >> t;
  while (t--) {
    solve();
    cout << "\n";
  }
  return 0;
}
