#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    int temp1, temp2;
    temp1 = abs(c - a);
    temp2 = abs(d - b);
    if (temp1 == 0 || temp2 == 0)
      cout << temp1 + temp2 << endl;
    else {
      cout << temp1 + temp2 + 2 << endl;
    }
  }
}
