#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int a1, a2, b1, b2;
    cin >> a1 >> b1 >> a2 >> b2;
    if (a1 == a2 && b1 == b2) {
      cout << 0 << endl;
    } else if (a1 == a2 || b1 == b2) {
      cout << abs(a2 - a1) + abs(b2 - b1) << endl;
    } else {
      cout << abs(a2 - a1) + abs(b2 - b1) + 2 << endl;
    }
  }
}
