#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long x, y, x1, y1;
  cin >> x >> y >> x1 >> y1;
  if (x1 != x && y1 != y)
    cout << abs(x - x1) + abs(y - y1) + 2 << "\n";
  else
    cout << abs(x - x1) + abs(y - y1) << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long test_cases = 1;
  cin >> test_cases;
  for (long long t = 1; t <= test_cases; t++) solve();
  return 0;
}
