#include <bits/stdc++.h>
using namespace std;
long long int factorial(long long int n) {
  return (n == 1 || n == 0) ? 1 : n * factorial(n - 1);
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    long long int a, b, c, d, ans = 0;
    cin >> a >> b >> c >> d;
    if (a == c || b == d)
      ans = abs(c - a) + abs(d - b);
    else
      ans = abs(c - a) + abs(d - b) + 2;
    cout << ans << "\n";
  }
  return 0;
}
