#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long x, y, a, b;
    cin >> x >> y >> a >> b;
    long long ans = abs(x - a) + abs(y - b);
    if (x == a || y == b) {
      cout << ans;
    } else {
      cout << ans + 2;
    }
    cout << "\n";
  }
}
