#include <bits/stdc++.h>
using namespace std;
int timeToMove(int x1, int x2, int y1, int y2) {
  if (x1 != x2 && y1 != y2) {
    if (x1 > x2) {
      if (y1 > y2) {
        return (x1 - x2 + y1 - y2 + 2);
      } else {
        return (x1 - x2 + y2 - y1 + 2);
      }
    } else {
      if (y1 > y2) {
        return (x2 - x1 + y1 - y2 + 2);
      } else {
        return (x2 - x1 + y2 - y1 + 2);
      }
    }
  } else if (x1 == x2 && y1 != y2) {
    if (y1 > y2) {
      return (y1 - y2);
    } else {
      return (y2 - y1);
    }
  } else if (x1 != x2 && y1 == y2) {
    if (x1 > x2) {
      return (x1 - x2);
    } else {
      return (x2 - x1);
    }
  } else {
    return 0;
  }
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int x1, x2, y1, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    cout << timeToMove(x1, x2, y1, y2) << endl;
  }
  return 0;
}
