#include <bits/stdc++.h>
using namespace std;
long long int ans;
int arr[300009];
void solve() {
  long long int x1, y1, x2, y2;
  cin >> x1 >> y1 >> x2 >> y2;
  ans = 2;
  if (!abs(x2 - x1) || !abs(y1 - y2)) ans = 0;
  ans += abs(x2 - x1) + abs(y1 - y2);
  cout << ans << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int testcases;
  cin >> testcases;
  for (int t = 0; t < testcases; ++t) {
    solve();
  }
  return 0;
}
