#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long int tt;
  cin >> tt;
  while (tt--) {
    long long int x, y, a, b;
    cin >> x >> y >> a >> b;
    if (min(abs(x - a), abs(y - b)) != 0) {
      cout << (min(abs(x - a), abs(y - b)) + 2) + max(abs(x - a), abs(y - b))
           << endl;
    } else
      cout << max(abs(x - a), abs(y - b)) << endl;
  }
}
