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