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