#include <bits/stdc++.h>
unsigned long long int M = 1000000007;
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int tt;
  cin >> tt;
  while (tt--) {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    int diff1 = abs(x1 - x2), diff2 = abs(y1 - y2), ans = diff1 + diff2;
    if (x1 == x2 || y1 == y2)
      cout << ans << "\n";
    else
      cout << ans + 2 << "\n";
  }
  return 0;
}
