#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long int m, x, y, a, b;
    cin >> x >> y >> a >> b;
    m = abs(x - a) + abs(y - b);
    if (x != a && y != b) m = m + 2;
    cout << m << "\n";
  }
}
