#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int t;
  cin >> t;
  while (t--) {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    int time(0);
    if (x1 == x2)
      time = abs(y1 - y2);
    else {
      time = abs(x1 - x2);
      if (y1 != y2) time += abs(y1 - y2) + 2;
    }
    cout << time << endl;
  }
  return 0;
}
