#include <bits/stdc++.h>
using namespace std;
int main() {
  int no_tests;
  cin >> no_tests;
  for (size_t i = 0; i < no_tests; i++) {
    long long x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    long long dx = abs(x1 - x2);
    long long dy = abs(y1 - y2);
    if (dx == 0) {
      cout << dy;
    } else if (dy == 0) {
      cout << dx;
    } else {
      cout << dx + dy + 2;
    }
    cout << "\n";
  }
  return 0;
}
