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