#include <bits/stdc++.h>
using namespace std;
long long int x, y, x2, y2;
void solve() {
  cin >> x >> y >> x2 >> y2;
  long long int ans = 0;
  ans += abs(x - x2);
  if (ans and y != y2) ans += 2;
  ans += abs(y - y2);
  cout << ans;
}
int32_t main() {
  {
    ios_base ::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
  };
  long long int t = 1;
  cin >> t;
  while (t--) {
    solve();
    cout << "\n";
  }
  return 0;
}
