#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    if (y1 == y2)
      cout << abs(x2 - x1) << "\n";
    else if (x1 == x2)
      cout << abs(y2 - y1) << "\n";
    else {
      int x, y;
      x = abs(x2 - x1);
      y = abs(y2 - y1);
      cout << x + y + 2 << "\n";
    }
  }
}
