#include <bits/stdc++.h>
using namespace std;
long long qabs(long long x) {
  if (x < 0) {
    x *= -1;
  }
  return x;
}
void solve() {
  long long x1, y1, x2, y2;
  cin >> x1 >> y1 >> x2 >> y2;
  x2 -= x1, y2 -= y1;
  if (qabs(x2) > 0 && qabs(y2) > 0) {
    cout << qabs(x2) + qabs(y2) + 2LL << '\n';
    return;
  }
  cout << qabs(x2) + qabs(y2) << '\n';
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) solve();
  return 0;
}
