#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cout.precision(10);
  long long t, x, y, a, b;
  cin >> t;
  while (t-- > 0) {
    cin >> x >> y >> a >> b;
    if (x == a || y == b) {
      cout << abs(x - a) + abs(y - b);
    } else {
      cout << abs(x - a) + abs(y - b) + 2;
    }
    cout << '\n';
  }
  return 0;
}
