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