#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
const long long mod = 1e9 + 7;
int t, x, y, xx, yy;
int main() {
  cin >> t;
  while (t--) {
    cin >> x >> y >> xx >> yy;
    cout << abs(x - xx) + abs(y - yy) +
                2 * ((abs(x - xx) && abs(y - yy)) ? 1 : 0)
         << endl;
  }
  return 0;
}
