#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
void solve() {
  long long x1, x2, y1, y2, ans;
  cin >> x1 >> y1 >> x2 >> y2;
  if (x1 == x2 || y1 == y2)
    ans = abs(x2 - x1) + abs(y2 - y1);
  else
    ans = abs(x2 - x1) + abs(y2 - y1) + 2;
  cout << ans;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed;
  cout << setprecision(10);
  int t = 1;
  cin >> t;
  for (int i = 1; i <= t; i++) {
    solve();
    cout << "\n";
  }
  return 0;
}
