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