#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int tc, x, y, tmp;
  cin >> tc;
  while (tc--) {
    cin >> x >> y >> tmp;
    x -= tmp;
    cin >> tmp;
    y -= tmp;
    if (x < 0) x = -x;
    if (y < 0) y = -y;
    if (x * y)
      cout << x + y + 2;
    else
      cout << x + y;
    if (tc) cout << endl;
  }
}
