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