#include <bits/stdc++.h>
using namespace std;
string S;
int main() {
  ios::sync_with_stdio(false);
  long long int T, a, b, c, d, e, f;
  cin >> T;
  while (T--) {
    cin >> a >> b >> c >> d;
    e = abs(a - c);
    f = abs(b - d);
    if (e > 0 and f > 0)
      cout << e + f + 2 << "\n";
    else
      cout << e + f << "\n";
  }
}
