#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  scanf("%lld", &t);
  while (t--) {
    long long x1, y1, x2, y2;
    scanf("%lld", &x1), scanf("%lld", &y1), scanf("%lld", &x2),
        scanf("%lld", &y2);
    long long dx = abs(x1 - x2), dy = abs(y1 - y2), ans = dx + dy;
    if (dx != 0 && dy != 0) ans += 2;
    printf("%lld\n", ans);
  }
  return 0;
}
