#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int tt;
  cin >> tt;
  while (tt--) {
    int xa, ya, xb, yb;
    cin >> xa >> ya >> xb >> yb;
    if (xa == xb || ya == yb) {
      int res;
      res = max(abs(xa - xb), abs(ya - yb));
      cout << res << '\n';
    } else {
      int res = abs(xa - xb) + abs(ya - yb);
      cout << res + 2 << '\n';
    }
  }
}
