#include <bits/stdc++.h>
using namespace std;
int solve(int x1, int y1, int x2, int y2) {
  int ans = 0;
  if (x1 == x2 || y1 == y2) {
    if (x1 == x2)
      ans = abs(y1 - y2);
    else if (y1 == y2)
      ans = abs(x1 - x2);
  } else {
    ans = abs(x1 - x2) + 2 + abs(y2 - y1);
  }
  return ans;
}
int main() {
  int t, i = 0;
  cin >> t;
  int a[t];
  for (i = 0; i < t; i++) {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    a[i] = solve(x1, y1, x2, y2);
  }
  for (i = 0; i < t; i++) {
    cout << a[i] << endl;
  }
  return 0;
}
