#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int x1, y1, x2, y2;
  cin >> x1 >> y1 >> x2 >> y2;
  if (x1 == x2) {
    cout << abs(y1 - y2) << "\n";
  } else if (y1 == y2) {
    cout << abs(x1 - x2) << "\n";
  } else {
    long long int vt = abs(y1 - y2);
    long long int hz = abs(x1 - x2);
    long long int ans = 0;
    if (vt > hz) {
      ans += vt;
      ans += hz - 1;
      ans += 3;
    } else {
      ans += hz;
      ans += vt - 1;
      ans += 3;
    }
    cout << ans << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int testcases;
  cin >> testcases;
  while (testcases--) {
    solve();
  }
  return 0;
}
