#include <bits/stdc++.h>
using namespace std;
double eps = 1e-9;
double pi = acos(-1);
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    long long x1, y1, x2, y2, n;
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2) {
      cout << max(y1, y2) - min(y1, y2) << "\n";
    } else if (y1 == y2) {
      cout << max(x1, x2) - min(x1, x2) << "\n";
    } else {
      n = max(y1, y2) - min(y1, y2) + max(x1, x2) - min(x1, x2) + 2;
      cout << n << "\n";
    }
  }
  return 0;
}
