#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxn = 1e5;
int t;
int X1, Y1, X2, Y2;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  while (cin >> t) {
    while (t--) {
      cin >> X1 >> Y1 >> X2 >> Y2;
      cout << abs(X1 - X2) + abs(Y1 - Y2) + (X1 != X2 && Y1 != Y2) * 2 << endl;
    }
  }
  return 0;
}
