#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    long long int ans1 = 0, ans2 = 0;
    long long int x1, y2, x2, y1;
    cin >> x1 >> y1 >> x2 >> y2;
    if (y1 == y2)
      cout << abs(x2 - x1) << endl;
    else if (x1 == x2)
      cout << abs(y2 - y1) << endl;
    else
      cout << abs(x2 - x1) + 2 + abs(y2 - y1) << endl;
  }
}
