#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    int x1, y1, x2, y2;
    cin >> x1;
    cin >> y1;
    cin >> x2;
    cin >> y2;
    int tt = abs(x2 - x1) + abs(y2 - y1);
    if (!((y2 == y1) || (x2 == x1))) {
      tt += 2;
    }
    cout << tt << "\n";
  }
  return 0;
}
