#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    long long int a, b, c, d;
    cin >> a >> b >> c >> d;
    long long int ans = 0;
    if (a == c && b == d) {
      cout << "0\n";
      continue;
    } else if (b == d) {
      ans = abs(c - a);
    } else if (a == c) {
      ans = abs(b - d);
    } else {
      long long int p = abs(a - c);
      long long int q = abs(b - d);
      ans = p;
      ans = ans + q;
      ans = ans + 2;
    }
    cout << ans << "\n";
  }
  return 0;
}
