#include <bits/stdc++.h>
using namespace std;
map<int, int> ct;
void solveA() {
  int x1, x2, y1, y2;
  cin >> x1 >> y1 >> x2 >> y2;
  if (x1 == x2 || y1 == y2) {
    x1 = abs(x1 - x2) + abs(y1 - y2);
  } else
    x1 = abs(x1 - x2) + abs(y1 - y2) + 2;
  cout << x1 << endl;
}
void solve() {
  string s, s1;
  cin >> s;
  s1 += s[0];
  int aprev = 0, b = 0;
  int ans = (int)s.size();
  for (int i = 0; i < (int)s.size(); i++) {
    if (s[i] == 'B') {
      if (aprev)
        ans -= 2, aprev--;
      else if (b)
        b--, ans -= 2;
      else
        b++, aprev = 0;
    } else {
      aprev++;
    }
  }
  cout << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int t;
  cin >> t;
  for (int i = 0; i < t; ++i) solveA();
}
