#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long a, b, c, d;
  cin >> a >> b >> c >> d;
  long long ans = 0, fl = 0;
  if (a != c && b != d)
    ans = abs(a - c) + abs(b - d) + 2;
  else
    ans = abs(a - c) + abs(b - d);
  cout << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  cin >> t;
  while (t--) solve();
  return 0;
  ;
}
