#include <bits/stdc++.h>
using namespace std;
long long t, ans;
long long x1, x2, y_1, y2, x, y;
int main() {
  std::ios::sync_with_stdio(0);
  ;
  cin >> t;
  while (t--) {
    cin >> x1 >> y_1 >> x2 >> y2;
    x = fabs(x1 - x2);
    y = fabs(y_1 - y2);
    if (x1 == x2 || y_1 == y2) {
      ans = x + y;
    } else
      ans = x + y + 2;
    cout << ans << endl;
  }
}
